1.0.3 • Published 5 years ago
hexo-charts v1.0.3
将matery主题中的文章发布统计图、标签统计图、文章分类统计图做成了插件。
安装
npm install hexo-chart -S使用
文章发布统计图
<div id="posts-chart"></div>标签统计图
<!-- "data-length"为显示标签个数(从多到少),默认为10 -->
<div id="tags-chart" data-length="10"></div>文章分类统计图
<div id="categories-chart"></div>说明
如果出现文章中文目录乱码现象,请添加属性data-encode="true".
因为使用Tag会导致文章获取不全,所以本插件直接使用html标签渲染,而不是使用Tag。
由于使用了cheerio模块,如果你使用了html压缩插件,可能会出现压缩报错,暂时无解。
截图
