npm i --save hexo-wordcount
在主题配置界面激活配置。
postInfo:
date: true
update: true
wordCount: false # 设置文章字数统计为 true.
totalCount: false # 设置站点文章总字数统计为 true.
min2read: false # 阅读时长.
readCount: false # 阅读次数.
执行以上代码安装字数统计插件并激活配置
结果执行hexo cl,hexo g ,hexo s均会报错,报错内容如下:
关键点在ERROR Plugin load failed: hexo-wordcount Error: Cannot find module 'hexo-util',
后发现是缺少hexo-util的包,只需执行以下语句即可解决
npm install hexo-util --save