HUGO
Menu
GitHub 86785 stars Mastodon

BuildDrafts

Reports reports whether draft publishing is enabled for the current build.

Syntax

SITE.BuildDrafts

Returns

bool

Deprecated in v0.156.0

See details.

By default, draft pages are not published when building a site. You can change this behavior with a command line flag:

hugo build --buildDrafts

Or by setting buildDrafts to true in your project configuration:

buildDrafts: true
buildDrafts = true
{
   "buildDrafts": true
}

Use the BuildDrafts method on a Site object to determine the current configuration:

{{ .Site.BuildDrafts }} → true