Hexo博客添加字数统计和阅读统计
安装hexo-wordcount
插件npm i --save hexo-wordcount
成功会在根目录下的package.json中多出"hexo-wordcount": "^6.0.1"
安装hexo-symbols-count-time
$ npm install hexo-symbols-count-time --save
安装eslint
$ npm install eslint --save
在站点配置文件添加如下配置
symbols_count_time:symbols: true# 文章字数统计time: true # 文章阅读时长total_symbols: true# 站点总字数统计total_time: true # 站点总阅读时长exclude_codeblock: false# 排除代码字数统计
在主题配置文件中添加如下配置
symbols_count_time:separated_meta: true# 是否另起一行(true的话不和发表时间等同一行)item_text_post: true# 首页文章统计数量前是否显示文字描述(本文字数、阅读时长)item_text_total: false # 页面底部统计数量前是否显示文字描述(站点总字数、站点阅读时长)awl: 4 # Average Word Lengthwpm: 275 # Words Per Minute(每分钟阅读词数)suffix: mins.
Next主题添加字数统计和阅读统计
在主题配置文件做如下更改
post_wordcount: # 字数统计item_text: true# 是否显示文字wordcount: true# 显示字数min2read: true# 显示阅读时间totalcount: true# 显示总数separated_meta: true# 是否分开
大功告成啦!