如何为你的树莓派安装一个好看的主题—Butterfly
本文是前文从零开始 Hexo博客搭建的后续。
文章有参考主题作者的博客
安装环境(一定要装!!!)
首先,cd至博客根目录
注意,需要首先安装好Node.js和Git!
1 | cd blog # 此处的blog更改为你所设置的名称 |
然后,安装cheerio和渲染器1
2npm install cheerio –save
npm install hexo-renderer-pug hexo-renderer-stylus --save
安装主题
可以选择标准版,git clone下来:1
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly
也可以选择dev版1
git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly
最后,更改博客根目录_config.yml1
theme: Butterfly
当然,也可以自行选择平滑升级(我自己没用),执行下面代码后可以通过git pull升级,但是之后配置文件就需要改butterfly.yml了,看个人喜好自愿执行下面步骤1
cp source/themes/Butterfly/_config.yml source/_data/butterfly.yml
恭喜,安装完成!
进行页面设置
1 | hexo new page tags # 标签页 |
然后编辑界面文件
标签页:1
nano source/tags/index.md
1
2
3title: 标签
date: 2020-03-01 00:00:00
type: "tags"
分类页:1
nano source/categories/index.md
1
2
3title: 分类
date: 2018-01-05 00:00:00
type: "categories"
友链页:1
nano source/link/index.md
1
2
3title: 友情链接
date: 2018-06-07 22:17:49
type: "link"
配置友链1
nano source/_data/link.yml
1
2
3
4
5
6
7
8
9
10
11
12
13class:
class_name: 友情链接
link_list:
1:
name: xxx #名称
link: https://blog.xxx.com # 链接
avatar: https://xxxxx/avatar.png # 头像
descr: xxxxxxx # 描述
2: # 内容同下
name: xxxxxx
link: https://www.xxxxxxcn/
avatar: https://xxxxx/avatar.png
descr: xxxxxxx
到这里差不多就完成基本配置了,更多配置信息可以前往作者的博客或者hexo-theme-melody获取。