本文主要是介绍Hexo博客NexT主题下添加字数统计和阅读时长,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
安装hexo-symbols-count-time
$ npm install hexo-symbols-count-time --save
如果安装完报如下提醒,还需安装eslint
D:\hexo\blog>npm install hexo-symbols-count-time --save
npm WARN babel-eslint@10.0.1 requires a peer of eslint@>= 4.12.1 but none is installed. You must install peer dependencies yourself.
安装eslint
$ npm install eslint --save
在站点配置文件添加如下配置
symbols_count_time:symbols: true # 文章字数统计time: true # 文章阅读时长total_symbols: true # 站点总字数统计total_time: true # 站点总阅读时长exclude_codeblock: false # 排除代码字数统计
在NexT主题配置文件添加如下配置(NexT主题已支持该插件,有的话无需再添加)
# Post wordcount display settings
# Dependencies: https://github.com/theme-next/hexo-symbols-count-time
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.
效果如下:
站点统计
文章统计
参考
theme-next/hexo-symbols-count-time
这篇关于Hexo博客NexT主题下添加字数统计和阅读时长的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!