mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
Merge commit '8b9803425e63e1b1801f8d5d676e96368d706722'
This commit is contained in:
@@ -12,10 +12,10 @@ toc: true
|
||||
aliases: [/content/build-options/]
|
||||
---
|
||||
|
||||
Build options are stored in a reserved front matter object named `_build` with these defaults:
|
||||
Build options are stored in a reserved front matter object named `build` with these defaults:
|
||||
|
||||
{{< code-toggle file=content/example/index.md fm=true >}}
|
||||
[_build]
|
||||
[build]
|
||||
list = 'always'
|
||||
publishResources = true
|
||||
render = 'always'
|
||||
@@ -55,17 +55,17 @@ render
|
||||
- `never`
|
||||
: Never render the page to disk, and exclude it from all page collections.
|
||||
|
||||
[page bundles]: content-management/page-bundles
|
||||
[page resources]: /content-management/page-resources
|
||||
[`Permalink`]: /methods/resource/permalink
|
||||
[`RelPermalink`]: /methods/resource/relpermalink
|
||||
[`Publish`]: /methods/resource/publish
|
||||
[page bundles]: /content-management/page-bundles/
|
||||
[page resources]: /content-management/page-resources/
|
||||
[`Permalink`]: /methods/resource/permalink/
|
||||
[`RelPermalink`]: /methods/resource/relpermalink/
|
||||
[`Publish`]: /methods/resource/publish/
|
||||
|
||||
{{% note %}}
|
||||
Any page, regardless of its build options, will always be available by using the [`.Page.GetPage`] or [`.Site.GetPage`] method.
|
||||
|
||||
[`.Page.GetPage`]: /methods/page/getpage
|
||||
[`.Site.GetPage`]: /methods/site/getpage
|
||||
[`.Page.GetPage`]: /methods/page/getpage/
|
||||
[`.Site.GetPage`]: /methods/site/getpage/
|
||||
{{% /note %}}
|
||||
|
||||
## Example -- headless page
|
||||
@@ -85,7 +85,7 @@ Set the build options in front matter:
|
||||
|
||||
{{< code-toggle file=content/headless/index.md fm=true >}}
|
||||
title = 'Headless page'
|
||||
[_build]
|
||||
[build]
|
||||
list = 'never'
|
||||
publishResources = false
|
||||
render = 'never'
|
||||
@@ -121,7 +121,7 @@ In the example above, note that:
|
||||
|
||||
Create a unpublished section whose content and resources can be included in other pages.
|
||||
|
||||
[branch bundle]: /content-management/page-bundles
|
||||
[branch bundle]: /content-management/page-bundles/
|
||||
|
||||
```text
|
||||
content/
|
||||
@@ -143,7 +143,7 @@ Set the build options in front matter, using the `cascade` keyword to "cascade"
|
||||
{{< code-toggle file=content/headless/_index.md fm=true >}}
|
||||
title = 'Headless section'
|
||||
[[cascade]]
|
||||
[cascade._build]
|
||||
[cascade.build]
|
||||
list = 'local'
|
||||
publishResources = false
|
||||
render = 'never'
|
||||
@@ -201,10 +201,10 @@ Set the build options in front matter, using the `cascade` keyword to "cascade"
|
||||
|
||||
{{< code-toggle file=content/glossary/_index.md fm=true >}}
|
||||
title = 'Glossary'
|
||||
[_build]
|
||||
[build]
|
||||
render = 'always'
|
||||
[[cascade]]
|
||||
[cascade._build]
|
||||
[cascade.build]
|
||||
list = 'local'
|
||||
publishResources = false
|
||||
render = 'never'
|
||||
@@ -247,7 +247,7 @@ Set the build options in front matter:
|
||||
|
||||
{{< code-toggle file=content/books/_index.md fm=true >}}
|
||||
title = 'Books'
|
||||
[_build]
|
||||
[build]
|
||||
render = 'never'
|
||||
list = 'never'
|
||||
{{< /code-toggle >}}
|
||||
@@ -294,7 +294,7 @@ Set the build options in front matter, using the `cascade` keyword to "cascade"
|
||||
{{< code-toggle file=content/internal/_index.md >}}
|
||||
title = 'Internal'
|
||||
[[cascade]]
|
||||
[cascade._build]
|
||||
[cascade.build]
|
||||
render = 'never'
|
||||
list = 'never'
|
||||
[cascade._target]
|
||||
|
Reference in New Issue
Block a user