关于主题的一些魔改

关于主题的一些魔改

警告

数据不备份,魔改两行泪

我的开源

盘点2024我的开源项目

自定义CSS

本站样式大部分为覆盖展示,不轻易修改主题文件

统计页面

效果如下,具体我已经忘记是看谁的文章了

统计页面

第一步:添加charts.js

主题目录 /themes/anzhiyu/scripts/helpers 下添加一个 charts.js

第二步:插入JS到Inject

_config.anzhiyu.yml文件中搜 Inject插入到bottom

html
<script src="https://lib.baomitu.com/echarts/4.9.0-rc.1/echarts.min.js"></script>

例子:

yaml
# Inject
# Insert the code to head (before '</head>' tag) and the bottom (before '</body>' tag)
# 插入代码到头部 </head> 之前 和 底部 </body> 之前
inject:
  head:
  bottom:
      - <script src="https://lib.baomitu.com/echarts/4.9.0-rc.1/echarts.min.js"></script>

第三步: 新建一个统计页面

bash
hexo new page charts

前往博客根目录下 source/charts/index.md,修改内容如下

markdown
---
title: 统计
type: "charts"
comments: false
aside: false
---

<script src="https://lib.baomitu.com/echarts/4.9.0-rc.1/echarts.min.js"></script>

<!-- 文章发布时间统计图 --> <!-- 2020-02是从2020年2月开始计算 -->
<div id="posts-chart" data-start="2020-02" style="border-radius: 8px; height: 300px; padding: 10px;"></div>
<!-- 文章标签统计图 --> <!-- data-length="10" 是显示的标签数量 -->
<div id="tags-chart" data-length="10" style="border-radius: 8px; height: 300px; padding: 10px;"></div>
<!-- 文章分类统计图 -->
<div id="categories-chart" data-parent="true" style="border-radius: 8px; height: 300px; padding: 10px;"></div>

接入Umami和关于页面的修改

之前写过文章了,直接食用

接入Umami并修改关于页面

即刻短文的修改

即刻短文的修改即本站朋友圈

即刻短文移动端仿微信朋友圈

最后

其实本站并没有做多修改,写此文章仅为记录,方便以后升级更新

魔改主题兼容轻量友链朋友圈
本地推送Github Actions再推送到服务器

评论区

评论加载中...