Featured image of post Frontmatter Configs

Frontmatter Configs

记忆力不好

yaml 格式的

以下的内容适用于本站,即由 hugo 搭建的 Stack 主题。
因搭建的语言或者框架不同,仅供其他读者参考。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
---
title: "标题"
description: "描述"
author: yuki
date: 2021-12-02T13:42:48+08:00
image: https://test.jpg
license: 
math: true
toc: false
slug: test
comments: true
categories: ["备份"]
tags: ["总结","markdown"]
keywords: ["Frontmatter","markdown"]
readingTime: true
expiryDate: 2023-07-18
hidden: false
draft: false 
---
  • --- 标记符号开始和结束
  • title: 页面的标题。
  • description: :提供页面的简短描述或摘要。
  • author: 页面的作者或作者列表。
  • date: 页面的日期。
  • image: :设置页面的头图或缩略图。
  • license: 页面的许可证。如果设置为false,许可证部分将被隐藏。默认:.Site.Params.Article.License.Default
  • math: 启用/禁用 KaTeX 渲染。
  • toc: 显示/隐藏页面的目录。默认:.Site.Params.Article.toc
  • slug: :设置页面的 URL 地址的自定义部分。
  • comments: 显示/隐藏页面的评论部分。
  • categories: 将页面分类到特定的类别。
  • tags: 为页面添加标签。
  • keywords: 页面的关键字。对于搜索引擎优化有用。
  • readingTime: 显示/隐藏页面的阅读时间,如果为false,将不显示在博客中。 默认是.Site.Params.Article.ReadingTime
  • expiryDate: 过了这个日期,内容不会被hugo发布。
  • hidden: 是否隐藏,如果为true,将不显示。
  • draft: :是否草稿内容,如果为true,将不显示在博客中。

注意冒号和空格

math 参考

$$ x=\frac{-b\pm\sqrt{b^2-4ac}}{2a} $$

1
2
3
$$
x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}
$$

参考

https://stack.jimmycai.com/writing/frontmatter
https://www.andbible.com/post/hugo-content-management-front-matter/

Sow nothing, reap nothing.
Built with Hugo 主题 StackJimmy 设计