Front Matter
了解如何在 Hexo 博客(旨在本主题中使用)文章中使用 frontmatter。
Front Matter
Front matter 是 Hexo 博客文章和页面的元数据部分,通常位于 Markdown 文件的开头。它使用 YAML 格式来定义文章或页面的属性,如标题、日期、类型、评论等。
示例
Front Matter 属性
属性 | 类型 | 描述 |
---|---|---|
title | string | 必须 页面标题 |
date | datetime | 必须 页面创建日期 |
type | string | 必须 关于、友情链接、朋友圈、即刻、工具箱页面需要配置 |
updated | datetime | 可选 页面更新日期 |
desc | string | 可选 页面描述 |
aside | boolean | 可选 是否开启侧边栏(默认true) |
comment | boolean | 可选 显示页面评论模块(默认 true) |
cover | string | 可选 页面顶部图片URL |
reprint | boolean | 可选 版权(默认为原创)为true时为转载 |
katex | boolean | 可选 显示 katex(默认 false) |
locate | string | 可选 文章创作地点 |
leftend | string | 可选 banner底部左侧文字 |
rightend | string | 可选 banner底部右侧文字 |
rightbtn | string | 可选 banner底部右侧按钮文字 |
rightbtnlink | string | 可选 banner底部右侧按钮跳转链接 |
container | boolean | 可选 是否开启容器(默认true) |