Front-matter

Front-matter

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

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

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
27
28
title:              #【必需】文章标题
date: #【必需】标签、分类、关于、音乐馆、友情链接、相册、相册详情、朋友圈、即刻页面需要配置
updated: #文章更新日期
tags: # - 文章标签
# - 文章标签
categories: #文章分类
keywords: #文章关键字
description: #文章描述
top_img: #文章顶部图片
comments: #显示文章评论模块 (默认 true)
cover: #文章缩略图(如果没有设置 top_img,文章页顶部将显示缩略图,可设为 false/图片地址/留空)
toc: #显示文章 TOC
toc_number: #显示 toc_number
toc_style_simple: #显示 toc 简洁模式
copyright: #显示文章版权模块(默认为设置中 post_copyright 的 enable 配置)
copyright_author: #文章版权模块的 文章作者
copyright_author_href: #文章版权模块的 文章作者 链接
copyright_url: #文章版权模块的 文章链接 链接
copyright_info: #文章版权模块的版权声明文字
mathjax:
katex:
aplayer: #在需要的页面加载 aplayer 的 js 和 css
highlight_shrink: #配置代码框是否折叠(true/false)(默认为设置中 highlight_shrink 的配置)
aside: #显示侧边栏 (默认 true)
swiper_index: #首页轮播图配置 index 索引,数字越小越靠前
top_group_index: #首页右侧卡片组配置, 数字越小越靠前
ai: #文章ai摘要
main_color: #文章主色,必须是16进制颜色且有6位'#b3ecfd'
  1. 首页轮播图配置: swiper_index, 数字越小越靠前
  2. 首页卡片配置: top_group_index, 数字越小越靠前

TIP

只需要在你的文章顶部的Front-matter配置swiper_indextop_group_index两个字段即可显示轮播图和推荐卡片

Page Front-matter用于页面配置

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

参考自:安知鱼主题官方文档