6.0.4 • Published 4 years ago

hexo-wordcount-sy v6.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

A fork from Hexo-WordCount

Installation

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

Usage

字数统计 WordCount

wordcount(post.content)

阅读时长预计 Min2Read

min2read(post.content)  // 单位:分钟

设置阅读速度 Set Reading Speed:

min2read(post.content, {cn: 300, en: 160})

总字数统计 TotalCount

totalcount(site)        // 12345
totalcount(site, 'k')   // 12.3k
totalcount(site, ',')   // 12,345

总阅读时长预计 TotalRead

totalread(site)         // 单位:分钟
totalread(site, 'h')    // 单位:小时

设置阅读速度 Set Reading Speed:

totalread(site, '', {cn: 300, en: 160})   // 单位:分钟
totalread(site, 'h', {cn: 300, en: 160})   // 单位:小时

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

6.0.4

4 years ago

6.0.3

4 years ago

6.0.2

4 years ago

6.0.1

4 years ago