Front Matter

了解如何在 Hexo 博客(旨在本主题中使用)文章中使用 frontmatter。

Front Matter

Front matter 是 Hexo 博客文章和页面的元数据部分,通常位于 Markdown 文件的开头。它使用 YAML 格式来定义文章或页面的属性,如标题、日期、类型、评论等。

示例

---
title:
date:
type:
comment:
cover:
katex:
reprint:
locate:
---

Front Matter 属性

属性类型描述
titlestring
必须
页面标题
datedatetime
必须
页面创建日期
typestring
必须
关于、友情链接、朋友圈、即刻、工具箱页面需要配置
updateddatetime
可选
页面更新日期
descstring
可选
页面描述
asideboolean
可选
是否开启侧边栏(默认true)
commentboolean
可选
显示页面评论模块(默认 true)
coverstring
可选
页面顶部图片URL
reprintboolean
可选
版权(默认为原创)为true时为转载
katexboolean
可选
显示 katex(默认 false)
locatestring
可选
文章创作地点
leftendstring
可选
banner底部左侧文字
rightendstring
可选
banner底部右侧文字
rightbtnstring
可选
banner底部右侧按钮文字
rightbtnlinkstring
可选
banner底部右侧按钮跳转链接
containerboolean
可选
是否开启容器(默认true)