Skip to content

ierhyna/hexo-reading-time

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NPM Version

hexo-reading-time

Hexo plugin that displays reading time for the article.

Installation

npm install --save hexo-reading-time

Usage

Basic Usage

To display reading time, add the function into post.ejs.

Ejs:

<%- readingTime(page.content) %>

Swig:

{{ readingTime(page.content) }}

Jade:

span= readingTime(page.content)

It will display X min. read.

Customization

You can customize the output by passing additional arguments.

Ejs:

<%- readingTime(page.content, 'min.', wordsperminute) %>

Swig:

{{ readingTime(page.content, 'min.', wordsperminute) }}

Jade:

span= readingTime(page.content, 'min.', wordsperminute)

Where:
'min.' - second argument - any string that represents suffix. Default is 'min. read'
wpm - number - words per minute. Default is 150.
Both arguments are optional.

License

MIT

About

Plugin for Hexo CMS to display reading time for article

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published