ReadingTimePublishPlugin

0.3.0

Reading time estimation plugin for Publish.
alexito4/ReadingTimePublishPlugin

What's New

0.3.0

2022-12-13T20:40:41Z

What's Changed

  • Updated Publish to 0.9.0 (macOS 12 required)
  • Update README.md by @johannes-codes in #3

New Contributors

Full Changelog: 0.2.0...0.3.0

PublishReadingTime

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

Reading time estimation plugin for Publish.

Installation

Start by adding the dependency to your project:

    dependencies: [
        ...
        .package(name: "ReadingTimePublishPlugin", url: "https://github.com/alexito4/ReadingTimePublishPlugin", from: "0.2.0")
    ],

Then assign it to your target:

    targets: [
        .target(
            name: "Foo",
            dependencies: [
                "Publish",
                ...
                "ReadingTimePublishPlugin"
            ]
        )
    ]

Usage

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

import ReadingTimePublishPlugin
...
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

Description

  • Swift Tools 5.5.0
View More Packages from this Author

Dependencies

Last updated: Sun Oct 20 2024 08:13:18 GMT-0900 (Hawaii-Aleutian Daylight Time)