HUGO
Menu
GitHub 86778 stars Mastodon

Draft

Reports whether the given page is a draft as defined in front matter.

Syntax

PAGE.Draft

Returns

bool

By default, Hugo does not publish draft pages when you build your project. To include draft pages when you build your project, use the --buildDrafts command line flag.

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