Hexo helper plugin for getting word count & estimated reading time
Built with ❤︎ by Tiaan and contributors
$ npm install --save hexo-reading-helper
# OR
$ yarn add hexo-reading-helper
Usage shown using ejs
To get reading time:
<%- reading(page.content).time() %> <!-- 1 min read -->
To get word count:
<%- reading(page.content).words() %> <!-- 50 words -->
Use your own custom formatting by passing a callback to the time
or words
function:
<%- reading(page.content).time(function(minutes) {
return 'About ' + minutes + 'min'
}) %> <!-- 1 min read -->
Set the number of words per a minute to base estimation on:
<%- reading(page.content, {wordsPerMinute: 400}).time() %>
Contributions are welcome. Please open up an issue or create PR if you would like to help out.
Note: If editing the README, please conform to the standard-readme specification.
Licensed under the MIT License.