HUGO
News Docs Themes Community GitHub

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 site. To include draft pages when you build your site, use the --buildDrafts command line flag.

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