https://github.com/willin/hexo-wordcount
A Word Count Plugin for Hexo
https://github.com/willin/hexo-wordcount
hexo hexo-plugin hexo-wordcount plugin post-minutes wordcount
Last synced: 3 months ago
JSON representation
A Word Count Plugin for Hexo
- Host: GitHub
- URL: https://github.com/willin/hexo-wordcount
- Owner: willin
- Created: 2015-06-17T09:06:37.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2023-04-28T15:30:25.000Z (about 2 years ago)
- Last Synced: 2024-10-29T22:37:31.236Z (8 months ago)
- Topics: hexo, hexo-plugin, hexo-wordcount, plugin, post-minutes, wordcount
- Language: JavaScript
- Homepage: https://npmjs.org/package/hexo-wordcount
- Size: 27.3 KB
- Stars: 180
- Watchers: 5
- Forks: 22
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# Hexo-WordCount
[](https://npmjs.org/package/hexo-wordcount) [](https://npmjs.org/package/hexo-wordcount) [](https://npmjs.org/package/hexo-wordcount)
## Installation
```bash
yarn add hexo-wordcount
# or
npm i --save hexo-wordcount
```## Usage
### 字数统计 WordCount
```js
wordcount(post.content)
```### 阅读时长预计 Min2Read
```js
min2read(post.content)
```设置阅读速度 Set Reading Speed:
```js
min2read(post.content, {cn: 300, en: 160})
// p.s. (v3.0.0 added)
```### 总字数统计 TotalCount
```js
totalcount(site)
```## Demo
### Swig
Post Count:
```swig
{{ wordcount(post.content) }}
```Post Minutes to Read:
```swig
{{ min2read(post.content) }}
```Total Count:
```swig
{{ totalcount(site) }}
```### Ejs
Post Count:
```ejs
<%= wordcount(post.content) %>
```Post Minutes to Read:
```ejs
<%= min2read(post.content) %>
```Total Count:
```ejs
<%= totalcount(site) %>
```### Jade
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)
```## LICENSE
MIT
Alipay Donation(通过支付宝捐赠):
