Draft

Draft


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

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.

content/posts/post-1.md
     
---
draft: true
title: Post 1
---
+++
draft = true
title = 'Post 1'
+++
{
   "draft": true,
   "title": "Post 1"
}
{{ .Draft }} → true