BuildDrafts
Reports reports whether draft publishing is enabled for the current build.
Syntax
SITE.BuildDrafts
Returns
bool
By default, draft pages are not published when building a site. You can change this behavior with a command line flag:
hugo build --buildDraftsOr 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 }} → trueLast updated:
February 23, 2026
:
content: Rename site configuration to project configuration (phase 2) (9243e9f6b)
Improve this page