前言

关于博客更新方式的有关内容请阅读:Hexo 框架 (十三):关于博客主题持续更新的问题和我的新配置方式

V8.0 更新内容

重要更新

1
2
3
4
5
6
7
8
9
10
11
12
13
-override: false

menu:
- home: / || fa fa-home
+ #home: / || fa fa-home
#about: /about/ || fa fa-user
#tags: /tags/ || fa fa-tags
#categories: /categories/ || fa fa-th
- archives: /archives/ || fa fa-archive
+ #archives: /archives/ || fa fa-archive
#schedule: /schedule/ || fa fa-calendar
#sitemap: /sitemap.xml || fa fa-sitemap
#commonweal: /404/ || fa fa-heartbeat
1
2
3
4
5
6
7
8
9
10
11
valine:
- appid: # Your leancloud application appid
- appkey: # Your leancloud application appkey
+ appId: # Your leancloud application appid
+ appKey: # Your leancloud application appkey
...
- guest_info: nick,mail,link # Custom comment header
+ meta: # Custom comment header
+ - nick
+ - mail
+ - link
  • 支持 highlight.js (9fdaba2)
  • 允许更多的代码高亮格式 (03e50d0)
1
2
3
4
5
6
7
8
9
codeblock:
...
- # Available values: normal | night | night eighties | night blue | night bright | solarized | solarized dark | galactic
- # See: https://github.com/chriskempson/tomorrow-theme
- highlight_theme: normal
+ # See: https://github.com/highlightjs/highlight.js/tree/master/src/styles
+ theme:
+ light: default
+ dark: dark

配置

代码高亮

1
2
3
4
5
6
7
8
9
10
11
codeblock:
theme:
light: agate
dark: dark
# Add copy button on codeblock
copy_button:
enable: true
# Show text copy result.
show_result: true
# Available values: default | flat | mac
style: mac

你可以在这里预览代码高亮的效果:highlightjs 选择你喜欢的style即可。

更换模板

1
2
3
4
5
6
7
8
9
10
11
custom_file_path:
#head: source/_data/head.njk
#header: source/_data/header.njk
#sidebar: source/_data/sidebar.njk
postMeta: source/_data/post-meta.njk
postBodyEnd: source/_data/post-body-end.njk
footer: source/_data/footer.njk
bodyEnd: source/_data/body-end.njk
variable: source/_data/variables.styl
#mixin: source/_data/mixins.styl
style: source/_data/styles.styl

同时将原 _data 目录下的 swig 文件后缀改为 njk 即可