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 25, 2026
:
Merge commit '0c2fa2460f485e0eca564dcccf36d34538374922' (b0d3364f1)
Improve this page