Giter Site home page Giter Site logo

hexo-reading-time's Introduction

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

hexo-reading-time's People

Contributors

ierhyna avatar s-moon avatar tomkallen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

hexo-reading-time's Issues

Error time limit proportions.

Например, запись с 4к словами. Плагин отображает, что чтение в 1 минуту можно. Как так то?)
P.S. Другой плагин (hexo-wordcount) говорит, что 25 минут.

Может стоит добавить какую-то опцию на установление скорости чтения?

Error loading plugin with Swig.

Before edit template, hexo clean && hexo g give this error:

/var/www/vhosts/_hexo/node_modules/hexo-reading-time/lib/readingtime.js:4
module.exports = function(content, prefix = 'min. read') {
                                          ^
ERROR Plugin load failed: hexo-reading-time
SyntaxError: Unexpected token =

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.