Swiftpack.co - alexito4/ReadingTimePublishPlugin as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by alexito4.
alexito4/ReadingTimePublishPlugin 0.3.0
Reading time estimation plugin for Publish.
⭐️ 31
🕓 1 year ago
macOS
.package(url: "https://github.com/alexito4/ReadingTimePublishPlugin.git", from: "0.3.0")

PublishReadingTime

Status 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

GitHub

link
Stars: 31
Last commit: 1 year ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Dependencies

Release Notes

0.3.0
1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/alexito4/ReadingTimePublishPlugin/compare/0.2.0...0.3.0

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics