Post Word Count Plugin of Hexo.
npm install hexo-wordcount-sybash
yarn add hexo-wordcount-sy
or
npm i --save hexo-wordcount-sy
`
Usage
$3
`js
wordcount(post.content)
`
$3
`js
min2read(post.content) // 单位:分钟
`
设置阅读速度 Set Reading Speed:
`js
min2read(post.content, {cn: 300, en: 160})
`
$3
`js
totalcount(site) // 12345
totalcount(site, 'k') // 12.3k
totalcount(site, ',') // 12,345
`
$3
`js
totalread(site) // 单位:分钟
totalread(site, 'h') // 单位:小时
`
设置阅读速度 Set Reading Speed:
`js
totalread(site, '', {cn: 300, en: 160}) // 单位:分钟
totalread(site, 'h', {cn: 300, en: 160}) // 单位:小时
`
Demo
$3
Post Count:
`swig
{{ wordcount(post.content) }}
`
Post Minutes to Read:
`swig
{{ min2read(post.content) }}
`
Total Count:
`swig
{{ totalcount(site) }}
`
$3
Post Count:
`ejs
<%= wordcount(post.content) %>
`
Post Minutes to Read:
`ejs
<%= min2read(post.content) %>
`
Total Count:
`ejs
<%= totalcount(site) %>
`
$3
Post Count:
`jade
span.post-count= wordcount(post.content)
`
Post Minutes to Read:
`jade
span.post-count= min2read(post.content)
`
Total Count:
`swig
span.post-count= totalcount(site)
``