1.必要条件
已经有了hexo框架。
拷贝以前的或直接下载,下载命令:1
hexo init myblog
2.主题下载
1 | git clone https://github.com/lishanying/hexo-theme-indigo.git |
3.放在hexo/themes下
4.站点配置
编辑站点配置文件,hexo/_config.yml1
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/
# Site
title: Sailing
subtitle: Sailing's Home
description: A blog of Sailing
keywords:
- blog
- stkevintan
- IT
- Web Front End
- Kevin Tan
- kevinsfork
author: Sailing
avatar: /images/avatar.jpg
favicon: /images/favicon.ico
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/'
url: http://lishangying.github.io
root: /
permalink: :year/:month/:day/:title/
permalink_defaults:
# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:
# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link: true # Open external links in new tab
filename_case: 0
render_drafts: false
post_asset_folder: true
relative_link: false
future: true
highlight:
enable: true
line_number: true
auto_detect: false
tab_replace:
# Category & Tag
default_category: uncategorized
category_map:
tag_map:
# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD
time_format: HH:mm:ss
# Pagination
## Set per_page to 0 to disable pagination
per_page: 5
pagination_dir: page
disqus_shortname: sailinghome
## Themes: https://hexo.io/themes/
#theme: material-flow
#theme: hexo-theme-next
theme: hexo-theme-indigo
search:
path: search.xml
field: post
autoprefixer:
exclude:
- '*.min.css'
# - 'last 2 versions'
# - '> 5%'
# Generator json content
jsonContent:
meta: false
keywords: false
pages:
title: true
slug: false
date: false
updated: false
comments: false
path: false
link: false
permalink: true
excerpt: false
keywords: false
text: true
raw: false
content: false
posts:
title: true
slug: false
date: false
updated: false
comments: false
path: false
link: false
permalink: true
excerpt: false
keywords: false
text: true
raw: false
content: false
categories: false
tags: false
feed:
type: atom
path: atom.xml
limit: 20
hub:
content:
# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
type: git
repo:
github: https://github.com/lishanying/lishanying.github.io.git
oschina: https://gitee.com/freeCunChangDaRen/freeCunChangDaRen.git
branch: master
```
#### 5.主题配置
编辑主题配置文件,themes/indigo/_config.yml
``` c
# 添加新菜单项遵循以下规则
menu:
home:
text: 主页
url: /
archives:
url: /archives
tags:
url: /tags
th-list:
text: Categories
url: /categories
github:
url: http://lishangying.github.io
target: _blank
# 你的头像url
avatar: /img/avatar.jpg
avatar_link: /
# 头像背景图
brand: /img/brand.jpg
favicon: /favicon.ico
email: 18810691321@163.com
# 设置 Android L Chrome 浏览器状态栏颜色
color: '#3F51B5'
# 页面标题
tags_title: Tags
archives_title: Archives
categories_title: Categories
# 文章截断
excerpt_render: false
excerpt_length: 200
excerpt_link: 阅读全文...
mathjax: false
archive_yearly: true
# 是否显示文章最后更新时间
show_last_updated: true
# 是否开启分享
share: true
# 是否开启打赏,关闭 reward: false
# 是否开启搜索
search: true
# 是否大屏幕下文章页隐藏导航
hideMenu: true
# 是否开启toc
toc:
list_number: true # 是否显示数字排序
# 文章页留言内容,hexo中所有变量及辅助函数等均可调用,具体请查阅 hexo.io
#ostMessage: #里可以写作者留言,标签和 hexo 中所有变量及辅助函数等均可调用,示例:<a href="<%- url_for(page.path).replace(/index\.html$/, '') %>" target="_blank" rel="external"><%- page.permalink.replace(/index\.html$/, '') %></a>
# 站长统计,如要开启,输入CNZZ站点id,如 cnzz: 1255152447
cnzz: false
# 百度统计,如要开启,改为你的 key
baidu_tongji: false
# 腾讯分析,如要开启,输入站点id
tajs: false
google_analytics: false
google_site_verification: false
less:
compress: true
paths:
- source/css/style.less
# 以下评论插件开启一个即可
# 是否开启 disqus
disqus_shortname: false
# 是否开启友言评论, 填写友言用户id
uyan_uid: false
# 是否使用 gitment,https://github.com/imsun/gitment
gitment: false
# client_id:
# client_secret:
# Valine Comment system. https://valine.js.org
valine:
enable: false # 如果你想使用valine,请将值设置为 true
appId:
appKey:
notify: false # Mail notify
verify: false # Verify code
avatar: mm # Gravatar style : mm/identicon/monsterid/wavatar/retro/hide
placeholder: Just go go # Comment Box placeholder
guest_info: nick,mail,link # Comment header info
pageSize: 10
# 规范网址
# 让搜索引擎重定向你的不同域名、不同子域、同域不同目录的站点到你期望的路径
# 假设配置为 canonical: http://imys.net,那么从搜索引擎中 www.imys.net 进入会重定向到 imys.net
canonical: false
# 版权起始年份
since_year: 2015
# 用户页面中作者相关的描述性文字,如不需要设为 false
about: 用户页面中作者相关的描述性文字,如不需要设为 false
# “不蒜子”访问量统计,详见 http://ibruce.info/2015/04/04/busuanzi/
visit_counter:
site_uv: 站点总访客数:
site_pv: 站点总访问量:
# 动态定义title
#itle_change:
# 设置为 true 发布后将使用 unpkg cdn 最新的主题样式
# 如果想让你的自定义样式生效,把此项设为 false
cdn: true
# 设置为 true 将使用 lightbox render 图片
lightbox: true
ICP_license: false
```
#### 6.重新启动
``` c
hexo s
7.本地浏览器验证
http://localhost:4000/
