mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-28 22:19:59 +02:00
Merge commit '9b0050e9aabe4be65c78ccf292a348f309d50ccd' as 'docs'
``` git subtree add --prefix=docs/ https://github.com/gohugoio/hugoDocs.git master --squash ``` Closes #11925
This commit is contained in:
28
docs/content/en/methods/site/BuildDrafts.md
Normal file
28
docs/content/en/methods/site/BuildDrafts.md
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
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
|
||||
```
|
Reference in New Issue
Block a user