ulka-plugin-reading-time
v1.1.5
Published
Plugin for ulka static site genrator to calculate reading time of markdown data.
Downloads
3
Readme
ulka-plugin-reading-time
Adds a medium-like reading time estimate to your ulka posts. Powered by reading time.
Installation
npm install ulka-plugin-reading-time
Add ulka-plugin-reading-time
to plugins array in ulka-config.js
// ulka-config.js
module.exports = {
...
plugins: [
...
"ulka-plugin-reading-time",
],
}
Usage
After the setup, readingTime key will be available in fields.
// values.fields.readingTime
{
text: '1 min read',
minutes: 1,
time: 60000,
words: 200
}
Customization
To customize ulka-plugin-reading-time
, you need to pass plugin as object to plugins array.
// ulka-config.js
module.exports = {
...
plugins: [
...
{
resolve: "ulka-plugin-reading-time",
options: {
// options accepted by reading-time (https://github.com/ngryman/reading-time)
}
},
],
}