效果预览

2022-08-21
✒️文章 : 0

图片预览

浅色模式
深色模式

配置步骤

首先安装hexo-butterfly-charts

1
npm install hexo-butterfly-charts --save

_config.yml中添加下面内容。

1
2
3
4
5
6
7
8
9
10
11
12
13
# 统计图表,支持发布文章统计、发布日历、Top标签统计、分类统计、分类雷达。
# see https://www.npmjs.com/package/hexo-butterfly-charts
charts:
enable: true # 是否启用功能
postsChart:
title: 文章发布统计 # 设置文章发布统计的标题,默认为空
interval: 1 # 横坐标间隔
tagsChart:
title: Top 10 标签统计 # 设置标签统计的标题,默认为空
interval: 1 # 横坐标间隔
postsCalendar_Title: #文章发布日历 # 设置发布日历的标题,默认为空
categoriesChart_Title: # 设置分类统计的标题,默认为空
categoriesRadar_Title: # 设置分类雷达的标题,默认为空

修改themes/butterfly/layout/archive.pug

1
2
3
4
5
6
7
8
9
10
extends includes/layout.pug

block content
include ./includes/mixins/article-sort.pug
#archive
#posts-calendar.js-pjax
- const archiveLength = findArchiveLength(fragment_cache)
.article-sort-title= _p('page.articles') + ' - ' + archiveLength
+articleSort(page.posts)
include includes/pagination.pug