All Projects → alexito4 → ReadingTimePublishPlugin

alexito4 / ReadingTimePublishPlugin

Licence: MIT license
Reading time estimation plugin for Publish.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to ReadingTimePublishPlugin

svelte-readotron
Svelte component to display an estimated reading time
Stars: ✭ 36 (+50%)
Mutual labels:  reading-time
TwitterPublishPlugin
A plugin for Publish that let's you easily embed tweets in your posts.
Stars: ✭ 70 (+191.67%)
Mutual labels:  publish-plugin
hast-util-reading-time
utility to estimate the reading time
Stars: ✭ 55 (+129.17%)
Mutual labels:  reading-time
CNAMEPublishPlugin
A plugin that generates a CNAME file for the Publish static site generator. 🚀
Stars: ✭ 38 (+58.33%)
Mutual labels:  publish-plugin

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].