-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cbdf44e
commit bf2d055
Showing
3 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
title: Statiq - Plugins - Reading Time | ||
lead: Building Statiq plugins | ||
description: Reading Time | ||
tags: | ||
- statiq | ||
author: alexhedley | ||
published: 2024-12-30 | ||
image: /posts/images/statiq-web.svg | ||
imageattribution: https://www.statiq.dev/web | ||
--- | ||
|
||
<!-- # Statiq - Plugins --> | ||
|
||
I've been keeping a list of Statiq Community extensions and uses on the main Discussions list: | ||
|
||
- Plugins: https://github.com/orgs/statiqdev/discussions/223 | ||
- Themes: https://github.com/orgs/statiqdev/discussions/227 | ||
|
||
I was reviewing some blog posts and found a few from _Jeremy Davis_, see [Statiq](https://blog.jermdavis.dev/tags/statiq/) 🏷 tag. | ||
|
||
To make this easier to add into my own blog I decided to make a new project: [Statiq.Plugins](https://github.com/alexhedley/statiq.plugins) and port the features there. | ||
|
||
> **Adding reading time estimates to blog posts from @ Jeremy Davis** | ||
> - https://blog.jermdavis.dev/posts/2023/reading-time-estimates-statiq | ||
In your `appsettings.json` add a new property `ReadingSpeed` and set it to your desired value: | ||
|
||
`"ReadingSpeed": 200` | ||
|
||
You can then override the `input/_header.cshtml` of your theme and place the calculated time after the tags. | ||
|
||
```html | ||
<span>[email protected]("ReadingTime") minutes</span> | ||
``` | ||
|
||
_Example_ | ||
|
||
You can see an example on my test site: https://alexhedley.com/statiqweb-example/posts/1 | ||
|
||
![Reading Time](images/statiq/reading_time.png "Reading Time") | ||
|
||
or | ||
|
||
![Reading Time](images/statiq/reading_time-jd.png "Reading Time") | ||
|
||
In the future I'm looking to add more functionality. I've raised a number of [Issues](https://github.com/AlexHedley/statiq.plugins/issues) to track them. If you have any ideas please add your own. | ||
|
||
## Code | ||
|
||
![Statiq.Plugins Icon](https://raw.githubusercontent.com/AlexHedley/statiq.plugins/main/src/Statiq.Plugins/icon.png "Statiq.Plugins Icon") | ||
|
||
[![NuGet Version](https://img.shields.io/nuget/v/Statiq.Plugins.svg?logo=nuget)](https://www.nuget.org/packages/Statiq.Plugins/) | ||
[![NuGet Downloads](https://img.shields.io/nuget/dt/Statiq.Plugins?logo=nuget/)](https://www.nuget.org/packages/Statiq.Plugins/) | ||
|
||
`dotnet add package Statiq.Plugins --version #.#.#` | ||
|
||
<?# Info ?> | ||
Update the `version` number (`#.#.#`) to the latest release. | ||
<?#/ Info ?> | ||
|
||
- https://github.com/alexhedley/statiq.plugins | ||
- https://github.com/AlexHedley/statiq.plugins/pkgs/nuget/Statiq.Plugins | ||
- https://www.nuget.org/packages/Statiq.Plugins/ |