草稿
Syntax
PAGE.Draft
Returns
bool
默认情况下,Hugo 在构建站点时不会发布草稿页面。如果要在构建站点时包含草稿页面,请使用 --buildDrafts
命令行标志。
content/posts/post-1.md
---
draft: true
title: 文章 1
---
+++
draft = true
title = '文章 1'
+++
{
"draft": true,
"title": "文章 1"
}
{{ .Draft }} → true