Skip to content
Reading time estimation plugin for Publish.
Swift
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows
.swiftpm/xcode
Sources/ReadingTimePublishPlugin
Tests
.gitignore
Package.resolved
Package.swift
README.md

README.md

PublishReadingTime

Status Swift 5.1 Swift Package Manager Mac & Linux Publish Plugin Twitter: @alexito4

Reading time estimation plugin for Publish.

Installation

Usage

The plugin can then be used within any publishing pipeline like this:

import PublishReadingTime
...
try DeliciousRecipes().publish(using: [
    ...
    .addMarkdownFiles(),
    .installPlugin(.readingTime()),
    ...
])

Note that it must be installed after the Items are created (in this case by addMarkdownFiles() ).

Then you can add the information on your Theme:

HTML(...
.p("\(item.readingTime.minutes) minutes"),
...

Author

Alejandro Martinez | http://alejandromp.com | @alexito4

You can’t perform that action at this time.