博客搭建 (四) 显示文章的字数和阅读时长

安装插件

1
npm install --save hexo-word-counter

Hexo 配置

在hexo的_config.yml中添加以下的配置

1
2
3
4
5
6
7
8
9
10
# count symbols
symbols_count_time:
symbols: true
time: true
total_symbols: true
total_time: true
exclude_codeblock: false
awl: 4
wpm: 275
suffix: "mins."

next 配置

在next的_config.yml中添加以下的配置

1
2
3
4
5
6
# Post wordcount display settings
# Dependencies: https://github.com/next-theme/hexo-word-counter
symbols_count_time:
separated_meta: true
item_text_post: true
item_text_total: false

本系列文章:
博客搭建 (一) 开始
博客搭建 (二) 链接谷歌域名
博客搭建 (三) 链接google分析
博客搭建 (四) 显示文章的字数和阅读时长
博客搭建 (五) 接入 Google AdSense (NexT v8.2.1)