Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ierhyna/hexo-reading-time
Plugin for Hexo CMS to display reading time for article
https://github.com/ierhyna/hexo-reading-time
hexo hexo-plugin
Last synced: about 2 months ago
JSON representation
Plugin for Hexo CMS to display reading time for article
- Host: GitHub
- URL: https://github.com/ierhyna/hexo-reading-time
- Owner: ierhyna
- License: mit
- Created: 2016-10-01T19:48:45.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-12-01T20:53:30.000Z (about 5 years ago)
- Last Synced: 2024-08-08T16:50:16.853Z (5 months ago)
- Topics: hexo, hexo-plugin
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 28
- Watchers: 2
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![NPM Version](https://img.shields.io/npm/v/hexo-reading-time.svg)](https://www.npmjs.com/package/hexo-reading-time)
# hexo-reading-time
[Hexo](https://hexo.io/) plugin that displays reading time for the article.## Installation
```
npm install --save hexo-reading-time
```## Usage
### Basic UsageTo 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