butterfly配置指南
配置文件介绍
- butterfly 的配置文件一般在
themes/butterfly/_config.yml中,但是一般情况下我们不直接修改这个文件,而是复制这个文件到根目录下,保存为_config.butterfly.yml,然后在_config.butterfly.yml中进行配置
blog 图片修改
- 首页图片修改位置如下
1
2# 首页图片
index_image: /img/example.png # /img/在source目录下 - 个人头像修改位置如下
1
2
3
4# 个人头像
avatar:
img: /img/example.png # example.png替换为自己的头像
effect: false # 关闭头像效果 - logo 修改位置如下
1
2
3
4# logo
logo:
img: /img/example.png # example.png替换为自己的logo
effect: false # 关闭logo效果 - 网站图标修改位置如下
1
2# 网站图标
favicon: /img/favicon.png
blog 导航栏配置
- 导航栏修改位置如下,不需要的可以用#注释掉
1
2
3
4
5
6
7
8# 导航栏
menu:
首页: / || fas fa-home
归档: /archives/ || fas fa-archive
标签: /tags/ || fas fa-tags
分类: /categories/ || fas fa-folder-open
友链: /link/ || fas fa-link
关于: /about/ || fas fa-heart - 如果导航栏里有
标签分类友链关于这几个选项,则需要分别执行以下命令1
2
3
4npx hexo new page tags
npx hexo new page categories
npx hexo new page link
npx hexo new page about - 命令执行后会在
source目录下生成对应的页面文件夹及文件,分别替换以下文件里的内容source/tags/index.md1
2
3
4
5
6
title: tags
date: 2026-08-23 02:35:32
type: tags
comments: falsesource/categories/index.md1
2
3
4
5
6
title: categories
date: 2026-08-23 02:35:32
type: categories
comments: falsesource/about/index.md页面可以自定义内容,例如添加个人介绍、联系邮箱等
侧边栏配置
- 侧边栏修改位置如下,不需要的可以用#注释掉
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28aside:
enable: true # 开启侧边栏
hide: false # 隐藏侧边栏
button: true # 显示侧边栏按钮
mobile: true # 开启移动端侧边栏
position: right # 侧边栏位置
display: # 侧边栏显示内容
archive: true # 显示归档
tag: true # 显示标签
category: true # 显示分类
card_author:
enable: true # 显示作者卡片
button:
enable: true # 显示作者卡片按钮
icon: fab fa-github # 作者卡片按钮图标
text: Follow Me # 作者卡片按钮文本
link: https://www.example.com/ # 作者卡片按钮链接
card_announcement:
enable: true # 显示公告卡片
content: 欢迎来到我的博客。 # 公告卡片内容
card_recent_post:
enable: true # 显示最近文章卡片
card_categories:
enable: true # 显示分类卡片
card_tags:
enable: true # 显示标签卡片
card_archives:
enable: false # 显示归档卡片
其他
- 单篇文章书写示例
1
2
3
4
5
6
7
8
9
title: 单篇文章书写示例
date: 2026-08-24 15:21:25
tags:
- 单篇文章
- 示例
categories: 技术文档
cover: /img/example.png
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Secco!
评论






