hexo/node_modules/hexo-wordcount
jkjoy 9a9cb42f53 20231003 update 2023-10-03 11:14:36 +08:00
..
README.md 20231003 update 2023-10-03 11:14:36 +08:00
index.js 20231003 update 2023-10-03 11:14:36 +08:00
package.json 20231003 update 2023-10-03 11:14:36 +08:00

README.md

Hexo-WordCount

npm npm npm

Installation

yarn add hexo-wordcount
# or
npm i --save hexo-wordcount

Usage

字数统计 WordCount

wordcount(post.content)

阅读时长预计 Min2Read

min2read(post.content)

设置阅读速度 Set Reading Speed:

min2read(post.content, {cn: 300, en: 160})
// p.s. (v3.0.0 added)

总字数统计 TotalCount

totalcount(site)

Demo

Swig

Post Count:

   <span class="post-count">{{ wordcount(post.content) }}</span>

Post Minutes to Read:

   <span class="post-count">{{ min2read(post.content) }}</span>

Total Count:

   <span class="post-count">{{ totalcount(site) }}</span>

Ejs

Post Count:

   <span class="post-count"><%= wordcount(post.content) %></span>

Post Minutes to Read:

   <span class="post-count"><%= min2read(post.content) %></span>

Total Count:

   <span class="post-count"><%= totalcount(site) %></span>

Jade

Post Count:

   span.post-count= wordcount(post.content)

Post Minutes to Read:

    span.post-count= min2read(post.content)

Total Count:

   span.post-count= totalcount(site)

LICENSE

MIT

Alipay Donation(通过支付宝捐赠)

qr