PostTemplate

关于Hugo的Stack渲染Markdown语言的笔记

文章模版

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
+++
date = '2026-01-27'
draft = true
title = '文章模版'

author = 'RuHeYun'
description = '这是一个副标题'
categories = ['Test', 'Hugo',]
tags = ['Post', 'Template',]
slug = 'post-template'
image = 'helena-hertz-wWZzXlDpMog-unsplash.jpg'

math = true
toc = true
comments = true
lastmod = '2026-01-28'
+++

参数说明

front matter参数使用的是toml格式

author:作者名

draft:草稿状态标识(true,false)

title:文章标题,显示在文章顶部和浏览器标签页

description:文章描述,副标题

date:文章发布日期

slug:自定义文章的URL路径,更改浏览器标签页显示

image:封面图片

categories:文章分类

tags:文章标签

lastmod:最后修改日期

math:数学公式支持(true,false)

toc:目录显示(true,false)

comments:是否开启评论区(true,false)

weight:文章的权重,越低排的越前,默认不设置按照发布日期排,如果置顶文章通常设置为 1

说明文档

https://stack.jimmycai.com/guide/

已经配置了自动更新最后更新时间功能,所以不用再显示定义lastmod参数。

根据CC BY-NC-SA 4.0许可
最后更新于 2026-02-25