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