A Publish plugin that makes it easy to get a read time for your articles.
To install it into your Publish package, add it as a dependency within your Package.swift
manifest:
let package = Package(
...
dependencies: [
...
.package(url: "https://github.com/artrmz/ReadTimePublishPlugin", from: "0.1.0")
],
targets: [
.target(
...
dependencies: [
...
"ReadTimePublishPlugin"
]
)
]
...
)
For more information on how to use the Swift Package Manager, check its official documentation.
import ReadTimePublishPlugin
...
.unwrap(item.readTime().time, { .span("\($0) min") })
...