Front-matter的基本认识

Front-matter 的基本认识

Front-mattermarkdown 文件最上方以 --- 分隔的区域,用于指定个别档案的变数。其中又分为两种 markdown 里

  1. Page Front-matter 用于页面配置
  2. Post Front-matter 用于文章页配置

先说明用的比较多的两个,标签和分类

1
2
tags: Hexo
categories: 博客搭建

单个标签和分类,直接写后面就可以,多个时这样写

1
2
3
4
5
6
7
8
9
10
---
title: jQuery对表单的操作及更多应用
date: 2022-01-07 22:53:43
categories:
- web前端
tags:
- jQuery
- 表格
- 表单验证
---

Page Front-matter

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
title:
date:
updated:
type:
comments:
description:
keywords:
top_img:
mathjax:
katex:
aside:
aplayer:
highlight_shrink:
type:
top_single_background:
写法 解释
title 【必需】页面标题
date 【必需】页面创建日期
type 【必需】标签、分类、关于、音乐馆、友情链接、相册、相册详情、朋友圈、即刻页面需要配置
updated 【可选】页面更新日期
description 【可选】页面描述
keywords 【可选】页面关键字
comments 【可选】显示页面评论模块(默认 true)
top_img 【可选】页面顶部图片
mathjax 【可选】显示 mathjax(当设置 mathjax 的 per_page: false 时,才需要配置,默认 false)
katex 【可选】显示 katex(当设置 katex 的 per_page: false 时,才需要配置,默认 false)
aside 【可选】显示侧边栏 (默认 true)
aplayer 【可选】在需要的页面加载 aplayer 的 js 和 css,请参考文章下面的音乐 配置
highlight_shrink 【可选】配置代码框是否展开(true/false)(默认为设置中 highlight_shrink 的配置)
top_single_background 【可选】部分页面的顶部模块背景图片

Post Front-matter

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
title:
date:
updated:
tags:
categories:
keywords:
description:
top_img:
comments:
cover:
toc:
toc_number:
toc_style_simple:
copyright:
copyright_author:
copyright_author_href:
copyright_url:
copyright_info:
mathjax:
katex:
aplayer:
highlight_shrink:
aside:
swiper_index: 1
top_group_index: 1
background: "#fff"
写法 解释
title 【必需】页面标题
date 【必需】页面创建日期
type 【必需】标签、分类、关于、音乐馆、友情链接、相册、相册详情、朋友圈、即刻页面需要配置
updated 【可选】页面更新日期
description 【可选】页面描述
keywords 【可选】页面关键字
comments 【可选】显示页面评论模块(默认 true)
top_img 【可选】页面顶部图片
mathjax 【可选】显示 mathjax(当设置 mathjax 的 per_page: false 时,才需要配置,默认 false)
katex 【可选】显示 katex(当设置 katex 的 per_page: false 时,才需要配置,默认 false)
aside 【可选】显示侧边栏 (默认 true)
aplayer 【可选】在需要的页面加载 aplayer 的 js 和 css,请参考文章下面的音乐 配置
highlight_shrink 【可选】配置代码框是否展开(true/false)(默认为设置中 highlight_shrink 的配置)
top_single_background 【可选】部分页面的顶部模块背景图片