BuildDrafts
Reports whether the current build includes draft pages.
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 --buildDrafts
Or by setting buildDrafts
to true
in your site configuration:
buildDrafts: true
buildDrafts = true
{
"buildDrafts": true
}
Use the BuildDrafts
method on a Site
object to determine the current configuration:
{{ .Site.BuildDrafts }} → true
Last updated:
March 5, 2025
:
content: Consolidate configuration documentation (b6cae5cbc)
Improve this page