mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-14 20:37:55 -05:00
9b0050e9aa
git-subtree-dir: docs git-subtree-split: 5c085a37b297bf12f59efeaae591418ec025c10d
28 lines
633 B
Markdown
28 lines
633 B
Markdown
---
|
|
title: BuildDrafts
|
|
description: Reports whether the current build includes draft pages.
|
|
categories: []
|
|
keywords: []
|
|
action:
|
|
related: []
|
|
returnType: bool
|
|
signatures: [SITE.BuildDrafts]
|
|
---
|
|
|
|
By default, draft pages are not published when building a site. You can change this behavior with a command line flag:
|
|
|
|
```sh
|
|
hugo --buildDrafts
|
|
```
|
|
|
|
Or by setting `buildDrafts` to `true` in your site configuration:
|
|
|
|
{{< code-toggle file=hugo >}}
|
|
buildDrafts = true
|
|
{{< /code-toggle >}}
|
|
|
|
Use the `BuildDrafts` method on a `Site` object to determine the current configuration:
|
|
|
|
```go-html-template
|
|
{{ .Site.BuildDrafts }} → true
|
|
```
|