Front-matter


Front-matter 是 markdown 文件最上方以 “ - - - “ 截取的区域,用于自定义配置文章页(Post)或页面(Page)。 由于有时候忘性大,忘记有哪些参数怎么配置,于是就有了这一篇文章,直接把各个参数及其作用都列举出来,到时候可以直接复制到文章页或页面配置中去,不需要的删除即可

注意:其中 title(标题) 和 date(创建日期),一般会自动生成。由于未来可能会增加插件,有的插件是针对文章或页面进行配置,需要添加参数,所以此篇文章更新频率可能比较高。比如 hexo-hide-posts 插件,此插件可以用来隐藏文章,在文章顶部 Front-matter 中添加 hidden: true 参数来对文章进行隐藏

Page Front-matter 页面配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
title:   【必需】页面标题
date: 【必需】页面创建日期
type: 【必需】标签、分类和友情链接三個页面需要配置
top_img: 【可选】页面顶部图片
aside: 【可选】显示侧边栏 (默认 true)
highlight_shrink: 【可选】配置代码框是否展开 (true/false) (默认为设置中 highlight_shrink 的配置)
keywords: 【可选】页面关键字
updated: 【可选】页面更新日期
description: 【可选】页面描述
comments: 【可选】显示页面评论模块 (默认 true)

mathjax: 【可选】显示 mathjax,以文本方式来显示数学公式 (当设置 mathjax 的 per_page: false 时,才需要配置,默认 false)
katex: 【可选】显示 katex (当设置 katex 的 per_page: false 时,才需要配置,默认 false)
aplayer: 【可选】在需要的页面加载 aplayer 的 js 和 css
random: 【可选】配置友情链接是否随机排序(默认为 false)
limit: 【可选】配置说说显示数量
type: 【可选】配置说说显示数量的类型 (date 或者 num)
value: 【可选】配置说说显示数量的值

Post Front-matterr 文章页配置

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
title:   【必需】文章标题
date: 【必需】文章创建日期
updated: 【可选】文章更新日期
tags: 【可选】文章标签
categories: 【可选】文章分类
top_img: 【可选】文章顶部图片
aside: 【可选】显示侧边栏 (默认 true)
swiper_index: 1 【可选】hexo-butterfly-swiper插件置顶轮播插件:非负整数,数字越大越靠前
keywords: 【可选】文章关键字
description: 【可选】文章描述
cover: 【可选】文章缩略图(如果沒有设置 top_img,文章頁顶部將显示缩略图,可设为 false/图片地址/留空)
highlight_shrink: 【可选】配置代码框是否展開 true/false (默认为设置中 highlight_shrink 的配置)
toc: 【可选】显示文章 toc(即文章目录,默认为设置中 toc 的 enable 配置)
toc_style_simple: 【可选】显示 toc 简洁模式
toc_number: 【可选】显示 toc_number(即目录前方的数字序号 true/false 默认为设置中 toc 的 number 配置)
copyright: 【可选】显示文章版权模块(默认为设置中 post_copyright 的 enable 配置)
copyright_author: 【可选】文章版权模块的文章作者
copyright_author_href 【可选】文章版权模块的文章作者链接
copyright_url: 【可选】文章版权模块的文章连结链接
copyright_info: 【可选】文章版权模块的版权声明文字
comments: 【可选】显示文章评论模块(默认 true)

mathjax: 【可选】显示 mathjax(当设置 mathjax 的 per_page: false 时,才需要配置,默认 false )
katex 【可选】显示 katex (当设置 katex 的 per_page: false 时,才需要配置,默认 false )
aplayer: 【可选】在需要的页面加载 aplayer 的 js 和 css,请參考文章下面的音乐 配置
abcjs: 【可选】加载 abcjs (当设置 abcjs 的 per_page: false 时,才需要配置,默认 false )
noticeOutdate: 【可选】文章过期提醒 (默认为设置中 noticeOutdate 的 enable 配置)