BlakePlugin.ReadTime
1.0.1
dotnet add package BlakePlugin.ReadTime --version 1.0.1
NuGet\Install-Package BlakePlugin.ReadTime -Version 1.0.1
<PackageReference Include="BlakePlugin.ReadTime" Version="1.0.1" />
<PackageVersion Include="BlakePlugin.ReadTime" Version="1.0.1" />
<PackageReference Include="BlakePlugin.ReadTime" />
paket add BlakePlugin.ReadTime --version 1.0.1
#r "nuget: BlakePlugin.ReadTime, 1.0.1"
#:package BlakePlugin.ReadTime@1.0.1
#addin nuget:?package=BlakePlugin.ReadTime&version=1.0.1
#tool nuget:?package=BlakePlugin.ReadTime&version=1.0.1
BlakePlugin.ReadTime
A Blake plugin that calculates estimated reading time for content based on 200 words per minute reading speed.
Features
- Automatically calculates reading time for all markdown pages
- Uses industry standard 200 words per minute reading speed
- Adds reading time to page metadata as
readTimeMinutes
- Works seamlessly with Blake's build process
Installation
Install the NuGet package:
dotnet add package BlakePlugin.ReadTime
Usage
Blake automatically discovers plugins added to your project, and runs them during the build process. Once added to your project, just bake your site as usual, and the plugin will process all markdown pages to calculate reading time.
blake bake
Specify your own words per minutes:
blake bake --readtine:wpm=500
The plugin will automatically process all markdown pages during the build and add a readTimeMinutes
metadata property to each page.
Accessing Reading Time
Each page's estimated reading time can be accessed from the page's metadata. This is accessible via the global generated content index.
// Example in a Razor template
var readingTime = GeneratedContentIndex.GetPages().FirstOrDefault(p => p.Slug == "your-page-slug")?.Metadata["readTimeMinutes"];
How It Works
The plugin:
- Runs after the bake process (
AfterBakeAsync
) - Counts words in each markdown page using regex pattern
\b\w+\b
- Calculates reading time using 200 words per minute by default (approximate adult reading average)
- Uses user-supplied WPM via CLI arguments, if present
- Rounds up to the nearest minute
- Adds the result to the page metadata
License
This project is licensed under MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- Blake.BuildTools (>= 1.0.12)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.