HUGO
Menu
GitHub 87548 stars Mastodon

Draft

报告给定页面是否为 front matter 中定义的草稿。

Syntax

PAGE.Draft

Returns

bool

默认情况下,Hugo 在构建站点时不发布草稿页面。要在构建站点时包含草稿页面,请使用 --buildDrafts 命令行标志。

---
draft: true
title: Post 1
---
+++
draft = true
title = 'Post 1'
+++
{
   "draft": true,
   "title": "Post 1"
}
{{ .Draft }} → true

Last updated: January 1, 0001
Improve this page