Hello World

行走即是圆梦,回望亦是前行。

0%

Hexo博客和Next主题配置文件_config说明

前言

这里简单记录下Hexo博客和Next主题配置文件_config说明

站点配置文件

这里是下面配置介绍的环境版本,可能与本博客搭建环境稍有不同:

Hexo: v4.2.1
NexT: v7.8.0

点击查看
_config.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
# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html, 允许自行更换页面语言
## Source: https://github.com/hexojs/hexo/

# Site: 网站配置
## 标题
title: "Xiao's Blog"
## 副标题
subtitle: "不忘初心, 方得始终"
## 网站描述
description: "不忘初心, 方得始终"
## 网站关键字
keywords: "Linux,Python"
## 作者
author: "YuXiao"
## 网站语言
language: "zh-CN"
## 时区
timezone: 'Asia/Shanghai'

# URL: 网址配置
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
root: /
## 文章链接地址格式
permalink: :year/:month/:day/:title/
permalink_defaults:
pretty_urls:
trailing_index: true
trailing_html: true

# Directory: 目录设置
## 资源目录
source_dir: source
## 公共目录, 存放生成的静态文件
public_dir: public
## 标签目录, 默认是tags, 实际存放在source/tags中
tag_dir: tags
## 档案目录, 默认是archives, 实际存放在source/archives中
archive_dir: archives
## 分类目录, 默认是categories, 实际存放在source/categories中
category_dir: categories
## 代码目录, 默认是downloads/code
code_dir: downloads/code
## 国际化目录, 默认跟language相同
i18n_dir: :lang
## 不需要渲染的文件或文件夹
skip_render:
- 'robots.txt'

# Writing: 写作配置
## 新建博文的默认名称
new_post_name: :title.md
## 默认布局模板
default_layout: post
## 是否将标题转换成标题形式(首字母大写)
titlecase: false
external_link:
## 在新标签页面中打开网页
enable: true
field: site
exclude: ''
## 把文件名称转换为禁用(0)、小写(1)、大写(2)
filename_case: 0
## 是否显示草稿
render_drafts: false
## 启用Asset目录, 文章资源目录
post_asset_folder: true
## 将链接改为与根目录的相对路径
relative_link: false
## 显示未来的文章
future: true
## 代码块的配置
highlight:
### 是否启用代码块
enable: true
### 是否显示行数
line_number: true
### 是否自动检测语言
auto_detect: true
### 将tab替换为N个空格
tab_replace: 4
wrap: true
hljs: true

# Home page setting: 主页设置
index_generator:
### 索引页的根路径
path: ''
### 每页的文章数
per_page: 5
### 排序方式
order_by: -date

# Category & Tag: 分类与标签
## 默认分类
default_category: uncategorized
category_map:
tag_map:

# Metadata elements: 元数据元素
meta_generator: true

# Date / Time format
## Hexo 使用 Moment.js 来解析与显示时间
date_format: YYYY-MM-DD
time_format: HH:mm:ss
## 若未提供更新日期,则使用发布日期
use_date_for_updated: true

# Pagination: 分页配置
## 设置 per_page 值为 0 则禁用分页
per_page: 5
pagination_dir: page

# 归档页的分页设置
archive_generator:
per_page: 20
yearly: true
monthly: true

# 标签页的分页设置
tag_generator:
per_page: 10

# Extensions: 拓展配置
## 主题
theme: next

# Sitemap: 站点地图
## 谷歌站点地图
## 依赖插件: npm install --no-optional --save hexo-generator-sitemap
sitemap:
path: sitemap.xml
## 百度站点地图
## 依赖插件: npm install --no-optional --save hexo-generator-baidu-sitemap
baidusitemap:
path: baidusitemap.xml

# Local Search: 本地搜索插件
## 依赖插件: npm install --no-optional --save hexo-generator-search
search:
path: search.xml
field: post
format: html
limit: 10000

# Deployment: 部署配置
deploy:
type: "rsync"
host: 127.0.0.1
user: root
root: /data/www
port: 22

主题配置文件

点击查看
themes/next/_config.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
211
212
213
# Hexo's Version: 4.2.0
# NexT's Version: 7.8.0

# 是否覆盖NexT主题的默认配置
## true: 覆盖默认配置, 必须包含所有的配置项
## false: 合并默认配置, 无需包含所有的配置项
override: false

# 是否提醒有新版本
reminder: true

# 删除垃圾文件
minify: true

# 自定义配置文件的路径
custom_file_path:
style: source/_data/styles.styl
footer: source/_data/footer.swig
variable: source/_data/variables.styl

# 自定义站点图标
favicon:
small: images/favicon.png
medium: images/favicon.png
apple_touch_icon: images/favicon.png
safari_pinned_tab: images/favicon.svg

# 页脚 - 是否显示语言切换
language_switcher: false

# 页脚 - 配置信息
footer:
## 指定站点的起始年
since: 2017

## 配置年份与版权信息之间的图标
icon:
### Font Awesome字体图标中的名称
name: heartbeat
### 设置图标为动态的
animated: true
### 图标颜色
color: "#CB1B45"

## 版权信息
copyright: YuXiao

## 由 Hexo&NexT 提供支持
powered: false

# 主题样式
scheme: Pisces

# 暗黑模式
darkmode: true

# 导航栏
menu:
home: / || home
archives: /archives/ || archive
categories: /categories/ || th
tags: /tags/ || tags
about: /about/ || user
messages: /messages/ || comments

# 图标和勋章
menu_settings:
icons: true
badges: false

# 侧边栏头像
avatar:
url: images/favicon.png
rounded: true
rotated: true

# 社交链接
social:
QQ: https://www.xiaocoder.com/images/QQ.png || qq
GitHub: https://github.com/YuXiaoCoder || github
E-Mail: mailto:xiao.950901@gmail.com || envelope

social_icons:
enable: true
icons_only: true
transition: true

links_settings:
icon: link
title: 友链
layout: block

links:
WordJian: http://wordjian.com/

# 文章底部 - 标签是否使用图标
tag_icon: true

# 打赏
reward_settings:
enable: true
animation: false
comment: "请作者喝瓶肥宅快乐水"

reward:
wechatpay: images/wechat-reward-image.png
alipay: images/alipay-reward-image.png

# 自适应移动设备
mobile_layout_economy: true

# 代码块
codeblock:
highlight_theme: "night eighties"
copy_button:
enable: true
show_result: true
style: default

# 回到顶部
back2top:
enable: true
sidebar: true
scrollpercent: true

# 阅读进度条
reading_progress:
enable: true
# Available values: top | bottom
position: top
color: "#37c6c0"
height: 3px

# 书签
bookmark:
enable: true
color: "#222"
save: auto

# 搜索引擎
## 在移动设备上禁止百度转换
disable_baidu_transformation: true

## 将站点信息添加到索引
index_with_subtitle: true

# 自动对外部 URL 使用 Base64 加密/解密
exturl: true

# 百度站长验证
baidu_site_verification: "twxo1mIvsV"

# 自动推送给百度,方便收录
baidu_push: true

# 支持图片的缩放功能
fancybox: true

# 延迟加载
lazyload: true

# 支持空白字符
pangu: true

# 快速链接
quicklink:
enable: true
home: true
archive: true
delay: true
timeout: 3000
priority: true
ignores:

# Valine - 评论
valine:
enable: true
appid: "<LeanCloud ID>"
appkey: "<LeanCloud KEY>"
notify: true # Mail notifier
verify: true # Verification code
placeholder: "ヾノ≧∀≦)o来啊,快活啊!"
avatar: robohash
guest_info: nick,mail
pageSize: 5 # Pagination size
language: zh-cn
visitor: false
comment_count: false
recordIP: true

# 不蒜子 - 网站计数
busuanzi_count:
enable: true
total_visitors: true
total_visitors_icon: user
total_views: true
total_views_icon: eye
post_views: true
post_views_icon: eye

# 本地搜索
local_search:
enable: true
trigger: auto
top_n_per_article: 1
unescape: true
preload: true

# 注释标签
note:
style: flat
icons: true
light_bg_offset: -18 | 6