Hexo配置文件(_config.yml)

打开blog目录下的Hexo的配置文件 _config.yml,进行自定义配置。(以下显示是通用配置)

1
2
3
4
5
6
7
8
language: zh-CN
timezone: 'Asia/Shanghai'

deploy:
type: 'git'
repository: #仓库地址
branch: main #分支一般是master、main

Butterfly配置文件(_config.butterfly.yml)

打开blog目录下的Butterfly配置文件_config.butterfly.yml,进行自定义修改配置。(以下显示是通用配置)

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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
nav:
logo: #左上角头像地址
#页面icon
favicon: #头像地址
#侧边栏处头像
avatar:
img: #头像地址
effect: false
#首页背景图
index_img:
#文章卡片默认显示图,可多个
default_cover:

post_meta:
# Home Page
page:
# Choose: created / updated / both
date_type: both #显示文章的创建和更新时间
# Choose: date / relative
date_format: date
categories: true
tags: false
label: true
post:
# Choose: left / center
position: center #文章页meta信息居中显示
# Choose: created / updated / both
date_type: both
# Choose: date / relative
date_format: date
categories: true
tags: true
label: true

#首页卡片双栏布局
index_layout: 7
#选择首页卡片双栏布局时,关闭主页文章节选,不会出现卡片混乱的情况
index_post_content:
method: false

#展示文章版权和许可协议
post_copyright:
enable: true
decode: false
author_href: #网站地址
license: CC BY-NC-SA 4.0
license_url: https://creativecommons.org/licenses/by-nc-sa/4.0/

#文章分页,下一篇为新文章
post_pagination: 2

#页脚信息
footer:
owner:
enable: true
since: #年份
custom_text: #自定义
# Copyright of theme and framework
copyright: false

#侧边栏
aside:
enable: true
hide: false
button: true
mobile: true
#侧边栏位置
position: right
display:
archive: false
tag: true
category: true
card_author:
enable: true
description:
#关闭头像下的github按钮
button:
enable: false
icon: fab fa-github
text: Follow Me
link: https://xxxxxxx
#关闭通告
card_announcement:
enable: false
content: This is my Blog
card_recent_post:
enable: true
limit: 5
sort: date
sort_order:
card_newest_comments:
enable: false
sort_order:
limit: 6
storage: 10
avatar: true
card_categories:
enable: true
limit: 8
expand: none
sort_order:
card_tags:
enable: true
limit: 10
#标签显示颜色
color: true
orderby: random
#升序排序
order: 1
sort_order:
card_archives:
enable: true
type: monthly
#YYYY年MM月
format: YYYY MMMM
order: -1
limit: 8
sort_order:
#系列文章卡片
card_post_series:
enable: true
series_title: true
#按标题排序
orderBy: 'title'
#升序
order: 1
card_webinfo:
enable: true
post_count: true
last_push_date: true
sort_order:
#网站开始运行时间
runtime_date:

#系列文章
series:
enable: true
orderBy: 'title'
order: 1
number: true

#滚动百分比显示
rightside_scroll_percent: true
#字数统计
wordcount:
enable: true

#搜索
search:
use: local_search
placeholder: 搜索文章


local_search:
preload: false
top_n_per_article: -1
unescape: false
CDN:
#评论配置选择Giscus
comments:
use: Giscus
text: true
lazyload: false
count: true
card_post_count: true


giscus:
repo: #仓库地址
repo_id: #giscus仓库id
category_id: ##giscus category的id
theme:
light: light
dark: dark
option:
data-lang: zh-CN #设置中文显示
data-input-position: bottom

#页面美化
beautify:
enable: true
field: post
title_prefix_icon: '\f0c1'
title_prefix_icon_color: '#F47466'

#主页subtitle
subtitle:
enable: true
effect: true
typed_option:
source: 1 #一言
sub: #自定义
#图片大图查看模式
lightbox: fancybox

#Mermaid
mermaid:
enable: true
code_write: true
theme:
light: default
dark: dark

# 图片懒加载
lazyload:
enable: true
field: site # site/post
placeholder:
blur: false

Butterfly配置文件详细配置见官方文章,原链接如下:

博客搭建系列文章