mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
Merge commit '87de22d7464e239c775fbd48ebce1665d5b1e80d'
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
---
|
||||
title: Build Options
|
||||
linkTitle: Build Options
|
||||
title: Build options
|
||||
description: Build options help define how Hugo must treat a given page when building the site.
|
||||
keywords: [build,content,front matter, page resources]
|
||||
categories: [content management]
|
||||
categories: [fundamentals,content management]
|
||||
menu:
|
||||
docs:
|
||||
parent: content-management
|
||||
@@ -13,7 +12,7 @@ weight: 70
|
||||
aliases: [/content/build-options/]
|
||||
---
|
||||
|
||||
They are stored in a reserved Front Matter object named `_build` with the following defaults:
|
||||
They are stored in a reserved front matter object named `_build` with the following defaults:
|
||||
|
||||
{{< code-toggle >}}
|
||||
_build:
|
||||
@@ -26,38 +25,30 @@ _build:
|
||||
|
||||
If `always`, the page will be treated as a published page, holding its dedicated output files (`index.html`, etc...) and permalink.
|
||||
|
||||
We extended this property from a boolean to an enum in Hugo 0.76.0. Valid values are:
|
||||
Valid values are:
|
||||
|
||||
never
|
||||
: The page will not be included in any page collection.
|
||||
|
||||
always (default)
|
||||
: The page will be rendered to disk and get a `RelPermalink` etc.
|
||||
|
||||
link
|
||||
: The page will be not be rendered to disk, but will get a `RelPermalink`.
|
||||
- `never`
|
||||
: The page will not be included in any page collection.
|
||||
- `always (default)`
|
||||
: The page will be rendered to disk and get a `RelPermalink` etc.
|
||||
- `link`
|
||||
: The page will be not be rendered to disk, but will get a `RelPermalink`.
|
||||
|
||||
#### list
|
||||
|
||||
Note that we extended this property from a boolean to an enum in Hugo 0.68.0.
|
||||
|
||||
Valid values are:
|
||||
|
||||
never
|
||||
: The page will not be included in any page collection.
|
||||
|
||||
always (default)
|
||||
: The page will be included in all page collections, e.g. `site.RegularPages`, `$page.Pages`.
|
||||
|
||||
local
|
||||
: The page will be included in any _local_ page collection, e.g. `$page.RegularPages`, `$page.Pages`. One use case for this would be to create fully navigable, but headless content sections.
|
||||
|
||||
If true, the page will be treated as part of the project's collections and, when appropriate, returned by Hugo's listing methods (`.Pages`, `.RegularPages` etc...).
|
||||
|
||||
- `never`
|
||||
: The page will not be included in any page collection.
|
||||
- `always (default)`
|
||||
: The page will be included in all page collections, e.g. `site.RegularPages`, `.Pages`.
|
||||
- `local`
|
||||
: The page will be included in any _local_ page collection, e.g. `.RegularPages`, `.Pages`. One use case for this would be to create fully navigable, but headless content sections.
|
||||
|
||||
#### publishResources
|
||||
|
||||
If set to true the [Bundle's Resources](/content-management/page-bundles) will be published.
|
||||
Setting this to false will still publish Resources on demand (when a resource's `.Permalink` or `.RelPermalink` is invoked from the templates) but will skip the others.
|
||||
If set to `true` (default) the [Bundle's Resources](/content-management/page-bundles) will be published.
|
||||
Setting this to `false` will still publish Resources on demand (when a resource's `.Permalink` or `.RelPermalink` is invoked from the templates) but will skip the others.
|
||||
|
||||
{{% note %}}
|
||||
Any page, regardless of their build options, will always be available using the [`.GetPage`](/functions/getpage) methods.
|
||||
@@ -67,7 +58,7 @@ Any page, regardless of their build options, will always be available using the
|
||||
|
||||
#### Not publishing a page
|
||||
|
||||
Project needs a "Who We Are" content file for Front Matter and body to be used by the homepage but nowhere else.
|
||||
Project needs a "Who We Are" content file for front matter and body to be used by the homepage but nowhere else.
|
||||
|
||||
{{< code-toggle file="content/who-we-are.md" fm=true copy=false >}}
|
||||
title: Who we are
|
||||
|
Reference in New Issue
Block a user