mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-24 15:28:54 +00:00
Merge commit '0c2fa2460f485e0eca564dcccf36d34538374922'
This commit is contained in:
@@ -5,3 +5,4 @@
|
||||
@import "./shortcodes.css";
|
||||
@import "./tableofcontents.css";
|
||||
@import "./view-transitions.css";
|
||||
@import "./todo-lists.css";
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
ul.todo {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
ul.todo li {
|
||||
display: flex;
|
||||
gap: 0.8em;
|
||||
}
|
||||
|
||||
ul.todo li input[type="checkbox"] {
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
flex-shrink: 0;
|
||||
margin-top: 0.3em;
|
||||
}
|
||||
@@ -105,14 +105,14 @@ body {
|
||||
padding-right: max(env(safe-area-inset-right), 1rem);
|
||||
}
|
||||
|
||||
@media screen(md) {
|
||||
@media (min-width: theme('--breakpoint-md')) {
|
||||
.px-main {
|
||||
padding-left: max(env(safe-area-inset-left), 2rem);
|
||||
padding-right: max(env(safe-area-inset-right), 2rem);
|
||||
}
|
||||
}
|
||||
|
||||
@media screen(lg) {
|
||||
@media (min-width: theme('--breakpoint-lg')) {
|
||||
.px-main {
|
||||
padding-left: max(env(safe-area-inset-left), 3rem);
|
||||
padding-right: max(env(safe-area-inset-right), 3rem);
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
|
||||
The returned collection follows a hierarchical sort where each subsequent dimension acts as a tie-breaker for the one above it.
|
||||
|
||||
1. [Language](g) is sorted by [weight](g) in ascending order, falling back to lexicographical order if weights are tied or undefined.
|
||||
1. [Version](g) is then sorted by weight in ascending order, with Hugo defaulting to a descending semantic sort for any ties.
|
||||
1. [Role](g) is finally sorted by weight in ascending order, using lexicographical order as the final fallback.
|
||||
@@ -2,7 +2,7 @@
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
|
||||
In this site configuration we enable rendering of [emoji shortcodes], and add emoji shortcodes before (pre) and after (post) each menu entry:
|
||||
In this project configuration we enable rendering of [emoji shortcodes], and add emoji shortcodes before (pre) and after (post) each menu entry:
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
enableEmoji = true
|
||||
|
||||
@@ -53,8 +53,8 @@ When you visit page-2:
|
||||
- The `Prev` method points to page-3
|
||||
- The `Next` method points to page-1
|
||||
|
||||
To reverse the meaning of _next_ and _previous_ you can change the sort direction in your [site configuration], or use the [`Next`] and [`Prev`] methods on a `Pages` object for more flexibility.
|
||||
To reverse the meaning of _next_ and _previous_ you can change the sort direction in your [project configuration], or use the [`Next`] and [`Prev`] methods on a `Pages` object for more flexibility.
|
||||
|
||||
[site configuration]: /configuration/page/
|
||||
[project configuration]: /configuration/page/
|
||||
[`Next`]: /methods/pages/prev
|
||||
[`Prev`]: /methods/pages/prev
|
||||
|
||||
@@ -53,9 +53,9 @@ When you visit page-2:
|
||||
- The `PrevInSection` method points to page-3
|
||||
- The `NextInSection` method points to page-1
|
||||
|
||||
To reverse the meaning of _next_ and _previous_ you can change the sort direction in your [site configuration], or use the [`Next`] and [`Prev`] methods on a `Pages` object for more flexibility.
|
||||
To reverse the meaning of _next_ and _previous_ you can change the sort direction in your [project configuration], or use the [`Next`] and [`Prev`] methods on a `Pages` object for more flexibility.
|
||||
|
||||
[site configuration]: /configuration/page/
|
||||
[project configuration]: /configuration/page/
|
||||
[`Next`]: /methods/pages/prev
|
||||
[`Prev`]: /methods/pages/prev
|
||||
|
||||
|
||||
@@ -10,14 +10,14 @@ action
|
||||
: Specify one of `crop`, `fill`, `fit`, or `resize`. This is applicable to the [`Process`][] method and the [`images.Process`][] filter. If you specify an action, you must also provide dimensions.
|
||||
|
||||
anchor
|
||||
: The focal point used when cropping or filling an image. Valid options include `TopLeft`, `Top`, `TopRight`, `Left`, `Center`, `Right`, `BottomLeft`, `Bottom`, `BottomRight`, or `Smart`. The `Smart` option utilizes the [`smartcrop.js`][] library to identify the most interesting area of the image. This defaults to the [`anchor`][] parameter in your site configuration.
|
||||
: The focal point used when cropping or filling an image. Valid options include `TopLeft`, `Top`, `TopRight`, `Left`, `Center`, `Right`, `BottomLeft`, `Bottom`, `BottomRight`, or `Smart`. The `Smart` option utilizes the [`smartcrop.js`][] library to identify the most interesting area of the image. This defaults to the [`anchor`][] parameter in your project configuration.
|
||||
|
||||
background color
|
||||
: The background color used when converting transparent images to formats that do not support transparency, such as PNG to JPEG. This color also fills the empty space created when rotating an image by a non-orthogonal angle if the space is not transparent and a background color is not specified in the processing specification. The value must be an RGB [hexadecimal color][]. This defaults to the [`bgColor`][] parameter in your site configuration.
|
||||
: The background color used when converting transparent images to formats that do not support transparency, such as PNG to JPEG. This color also fills the empty space created when rotating an image by a non-orthogonal angle if the space is not transparent and a background color is not specified in the processing specification. The value must be an RGB [hexadecimal color][]. This defaults to the [`bgColor`][] parameter in your project configuration.
|
||||
|
||||
compression
|
||||
: {{< new-in 0.153.5 />}}
|
||||
: The encoding strategy used for the image. Options are `lossy` or `lossless`. Note that `lossless` is only supported by the WebP format. This defaults to the [`compression`][] parameter in your site configuration.
|
||||
: The encoding strategy used for the image. Options are `lossy` or `lossless`. Note that `lossless` is only supported by the WebP format. This defaults to the [`compression`][] parameter in your project configuration.
|
||||
|
||||
dimensions
|
||||
: The dimensions of the resulting image, in pixels. The format is `WIDTHxHEIGHT` where `WIDTH` and `HEIGHT` are whole numbers. When resizing an image, you may specify only the width (such as `600x`) or only the height (such as `x400`) for proportional scaling. Specifying both width and height when resizing an image may result in non-proportional scaling. When cropping, fitting, or filling, you must provide both width and height such as `600x400`.
|
||||
@@ -26,7 +26,7 @@ format
|
||||
: The format of the resulting image. Valid options include `bmp`, `gif`, `jpeg`, `png`, `tiff`, or `webp`. This defaults to the format of the source image.
|
||||
|
||||
hint
|
||||
: The encoding preset used when processing WebP images, equivalent to the `-preset` flag for the [`cwebp`][] CLI. Valid options include `drawing`, `icon`, `photo`, `picture`, or `text`. This defaults to the [`hint`][] parameter in your site configuration.
|
||||
: The encoding preset used when processing WebP images, equivalent to the `-preset` flag for the [`cwebp`][] CLI. Valid options include `drawing`, `icon`, `photo`, `picture`, or `text`. This defaults to the [`hint`][] parameter in your project configuration.
|
||||
|
||||
Value|Example
|
||||
:--|:--
|
||||
@@ -37,10 +37,10 @@ hint
|
||||
`text`|Image that is primarily text
|
||||
|
||||
quality
|
||||
: The visual fidelity of the image, applicable to JPEG and WebP formats when using `lossy` compression. The format is `qQUALITY` where `QUALITY` is a whole number between `1` and `100`, inclusive. Lower numbers prioritize smaller file size, while higher numbers prioritize visual clarity. This defaults to the [`quality`][] parameter in your site configuration.
|
||||
: The visual fidelity of the image, applicable to JPEG and WebP formats when using `lossy` compression. The format is `qQUALITY` where `QUALITY` is a whole number between `1` and `100`, inclusive. Lower numbers prioritize smaller file size, while higher numbers prioritize visual clarity. This defaults to the [`quality`][] parameter in your project configuration.
|
||||
|
||||
resampling filter
|
||||
: The algorithm used to calculate new pixels when resizing, fitting, or filling an image. Common options include `box`, `lanczos`, `catmullRom`, `mitchellNetravali`, `linear`, or `nearestNeighbor`. This defaults to the [`resampleFilter`][] parameter in your site configuration.
|
||||
: The algorithm used to calculate new pixels when resizing, fitting, or filling an image. Common options include `box`, `lanczos`, `catmullRom`, `mitchellNetravali`, `linear`, or `nearestNeighbor`. This defaults to the [`resampleFilter`][] parameter in your project configuration.
|
||||
|
||||
Filter|Description
|
||||
:--|:--
|
||||
@@ -56,7 +56,7 @@ resampling filter
|
||||
rotation
|
||||
: The number of whole degrees to rotate an image counter-clockwise. The format is `rDEGREES` where `DEGREES` is a whole number. Hugo performs rotation before any other transformations, so your [target dimensions](#dimensions) and any [anchor](#anchor) should refer to the image orientation after rotation. Use `r90`, `r180`, or `r270` for orthogonal rotations, or arbitrary angles such as `r45`. To rotate clockwise, use a negative number such as `r-45`. To automatically rotate an image based on its Exif orientation tag, use the [`images.AutoOrient`][] filter instead of manual rotation.
|
||||
|
||||
Rotating by non-orthogonal values increases the image extents to fit the rotated corners. For formats supporting alpha channels such as PNG or WebP, this resulting empty space is transparent by default. If the target format does not support transparency such as JPEG, or if you explicitly specify a [background color](#background-color) in the processing specification, the space is filled. If a color is required but not specified in the processing string, it defaults to the [`bgColor`][] parameter in your site configuration.
|
||||
Rotating by non-orthogonal values increases the image extents to fit the rotated corners. For formats supporting alpha channels such as PNG or WebP, this resulting empty space is transparent by default. If the target format does not support transparency such as JPEG, or if you explicitly specify a [background color](#background-color) in the processing specification, the space is filled. If a color is required but not specified in the processing string, it defaults to the [`bgColor`][] parameter in your project configuration.
|
||||
|
||||
[`anchor`]: /configuration/imaging/#anchor
|
||||
[`bgcolor`]: /configuration/imaging/#bgcolor
|
||||
|
||||
@@ -6,7 +6,7 @@ Before we can use a `Taxonomy` method, we need to capture a `Taxonomy` object.
|
||||
|
||||
## Capture a Taxonomy object
|
||||
|
||||
Consider this site configuration:
|
||||
Consider this project configuration:
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
[taxonomies]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
_comment: Do not remove front matter.
|
||||
---
|
||||
|
||||
By default, Hugo will throw an error and fail the build if it cannot resolve the path. You can change this to a warning in your site configuration, and specify a URL to return when the path cannot be resolved.
|
||||
By default, Hugo will throw an error and fail the build if it cannot resolve the path. You can change this to a warning in your project configuration, and specify a URL to return when the path cannot be resolved.
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
refLinksErrorLevel = 'warning'
|
||||
|
||||
@@ -61,10 +61,10 @@ weight: 20
|
||||
## Content management
|
||||
|
||||
[Multidimensional content model]
|
||||
: Generate pages across any combination of language, role, and version from a single source. This allows a single piece of content to be published to multiple [sites](g) within your project, removing the need to duplicate files for different audiences or versions.
|
||||
: Generate pages across any combination of language, version, and role from a single source. This allows a single piece of content to be published to multiple [sites](g) within your project, removing the need to duplicate files for different audiences or versions.
|
||||
|
||||
[Content adapters]
|
||||
: Create content adapters to dynamically add content when building your site. For example, use a content adapter to create pages from a remote data source such as JSON, TOML, YAML, or XML.
|
||||
: Create content adapters to dynamically add content when building your project. For example, use a content adapter to create pages from a remote data source such as JSON, TOML, YAML, or XML.
|
||||
|
||||
[Taxonomies]
|
||||
: Classify content to establish simple or complex logical relationships between pages. For example, create an authors taxonomy, and assign one or more authors to each page. Among other uses, the taxonomy system provides an inverted, weighted index to render a list of related pages, ordered by relevance.
|
||||
|
||||
@@ -5,11 +5,11 @@ url: /commands/hugo/
|
||||
---
|
||||
## hugo
|
||||
|
||||
Build your site
|
||||
Build your project
|
||||
|
||||
### Synopsis
|
||||
|
||||
hugo is the main command, used to build your Hugo site.
|
||||
hugo is the main command, used to build your Hugo project.
|
||||
|
||||
Hugo is a Fast and Flexible Static Site Generator
|
||||
built with love by spf13 and friends in Go.
|
||||
@@ -68,17 +68,16 @@ hugo [flags]
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo build](/commands/hugo_build/) - Build your site
|
||||
* [hugo build](/commands/hugo_build/) - Build your project
|
||||
* [hugo completion](/commands/hugo_completion/) - Generate the autocompletion script for the specified shell
|
||||
* [hugo config](/commands/hugo_config/) - Display site configuration
|
||||
* [hugo config](/commands/hugo_config/) - Display project configuration
|
||||
* [hugo convert](/commands/hugo_convert/) - Convert front matter to another format
|
||||
* [hugo deploy](/commands/hugo_deploy/) - Deploy your site to a cloud provider
|
||||
* [hugo deploy](/commands/hugo_deploy/) - Deploy your project to a cloud provider
|
||||
* [hugo env](/commands/hugo_env/) - Display version and environment info
|
||||
* [hugo gen](/commands/hugo_gen/) - Generate documentation and syntax highlighting styles
|
||||
* [hugo import](/commands/hugo_import/) - Import a site from another system
|
||||
* [hugo import](/commands/hugo_import/) - Import a project from another system
|
||||
* [hugo list](/commands/hugo_list/) - List content
|
||||
* [hugo mod](/commands/hugo_mod/) - Manage modules
|
||||
* [hugo new](/commands/hugo_new/) - Create new content
|
||||
* [hugo server](/commands/hugo_server/) - Start the embedded web server
|
||||
* [hugo version](/commands/hugo_version/) - Display version
|
||||
|
||||
|
||||
@@ -5,11 +5,11 @@ url: /commands/hugo_build/
|
||||
---
|
||||
## hugo build
|
||||
|
||||
Build your site
|
||||
Build your project
|
||||
|
||||
### Synopsis
|
||||
|
||||
build is the main command, used to build your Hugo site.
|
||||
build is the main command, used to build your Hugo project.
|
||||
|
||||
Hugo is a Fast and Flexible Static Site Generator
|
||||
built with love by spf13 and friends in Go.
|
||||
@@ -68,5 +68,4 @@ hugo build [flags]
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo](/commands/hugo/) - Build your site
|
||||
|
||||
* [hugo](/commands/hugo/) - Build your project
|
||||
|
||||
@@ -38,9 +38,8 @@ See each sub-command's help for details on how to use the generated script.
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo](/commands/hugo/) - Build your site
|
||||
* [hugo](/commands/hugo/) - Build your project
|
||||
* [hugo completion bash](/commands/hugo_completion_bash/) - Generate the autocompletion script for bash
|
||||
* [hugo completion fish](/commands/hugo_completion_fish/) - Generate the autocompletion script for fish
|
||||
* [hugo completion powershell](/commands/hugo_completion_powershell/) - Generate the autocompletion script for powershell
|
||||
* [hugo completion zsh](/commands/hugo_completion_zsh/) - Generate the autocompletion script for zsh
|
||||
|
||||
|
||||
@@ -62,4 +62,3 @@ hugo completion bash
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo completion](/commands/hugo_completion/) - Generate the autocompletion script for the specified shell
|
||||
|
||||
|
||||
@@ -53,4 +53,3 @@ hugo completion fish [flags]
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo completion](/commands/hugo_completion/) - Generate the autocompletion script for the specified shell
|
||||
|
||||
|
||||
@@ -50,4 +50,3 @@ hugo completion powershell [flags]
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo completion](/commands/hugo_completion/) - Generate the autocompletion script for the specified shell
|
||||
|
||||
|
||||
@@ -64,4 +64,3 @@ hugo completion zsh [flags]
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo completion](/commands/hugo_completion/) - Generate the autocompletion script for the specified shell
|
||||
|
||||
|
||||
@@ -5,11 +5,11 @@ url: /commands/hugo_config/
|
||||
---
|
||||
## hugo config
|
||||
|
||||
Display site configuration
|
||||
Display project configuration
|
||||
|
||||
### Synopsis
|
||||
|
||||
Display site configuration, both default and custom settings.
|
||||
Display project configuration, both default and custom settings.
|
||||
|
||||
```
|
||||
hugo config [command] [flags]
|
||||
@@ -48,6 +48,5 @@ hugo config [command] [flags]
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo](/commands/hugo/) - Build your site
|
||||
* [hugo](/commands/hugo/) - Build your project
|
||||
* [hugo config mounts](/commands/hugo_config_mounts/) - Print the configured file mounts
|
||||
|
||||
|
||||
@@ -41,5 +41,4 @@ hugo config mounts [flags] [args]
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo config](/commands/hugo_config/) - Display site configuration
|
||||
|
||||
* [hugo config](/commands/hugo_config/) - Display project configuration
|
||||
|
||||
@@ -40,8 +40,7 @@ See convert's subcommands toJSON, toTOML and toYAML for more information.
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo](/commands/hugo/) - Build your site
|
||||
* [hugo](/commands/hugo/) - Build your project
|
||||
* [hugo convert toJSON](/commands/hugo_convert_tojson/) - Convert front matter to JSON
|
||||
* [hugo convert toTOML](/commands/hugo_convert_totoml/) - Convert front matter to TOML
|
||||
* [hugo convert toYAML](/commands/hugo_convert_toyaml/) - Convert front matter to YAML
|
||||
|
||||
|
||||
@@ -44,4 +44,3 @@ hugo convert toJSON [flags] [args]
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo convert](/commands/hugo_convert/) - Convert front matter to another format
|
||||
|
||||
|
||||
@@ -44,4 +44,3 @@ hugo convert toTOML [flags] [args]
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo convert](/commands/hugo_convert/) - Convert front matter to another format
|
||||
|
||||
|
||||
@@ -44,4 +44,3 @@ hugo convert toYAML [flags] [args]
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo convert](/commands/hugo_convert/) - Convert front matter to another format
|
||||
|
||||
|
||||
@@ -5,11 +5,11 @@ url: /commands/hugo_deploy/
|
||||
---
|
||||
## hugo deploy
|
||||
|
||||
Deploy your site to a cloud provider
|
||||
Deploy your project to a cloud provider
|
||||
|
||||
### Synopsis
|
||||
|
||||
Deploy your site to a cloud provider
|
||||
Deploy your project to a cloud provider
|
||||
|
||||
See https://gohugo.io/hosting-and-deployment/hugo-deploy/ for detailed
|
||||
documentation.
|
||||
@@ -51,5 +51,4 @@ hugo deploy [flags] [args]
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo](/commands/hugo/) - Build your site
|
||||
|
||||
* [hugo](/commands/hugo/) - Build your project
|
||||
|
||||
@@ -40,5 +40,4 @@ hugo env [flags] [args]
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo](/commands/hugo/) - Build your site
|
||||
|
||||
* [hugo](/commands/hugo/) - Build your project
|
||||
|
||||
@@ -36,8 +36,7 @@ Generate documentation for your project using Hugo's documentation engine, inclu
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo](/commands/hugo/) - Build your site
|
||||
* [hugo](/commands/hugo/) - Build your project
|
||||
* [hugo gen chromastyles](/commands/hugo_gen_chromastyles/) - Generate CSS stylesheet for the Chroma code highlighter
|
||||
* [hugo gen doc](/commands/hugo_gen_doc/) - Generate Markdown documentation for the Hugo CLI
|
||||
* [hugo gen man](/commands/hugo_gen_man/) - Generate man pages for the Hugo CLI
|
||||
|
||||
|
||||
@@ -49,4 +49,3 @@ hugo gen chromastyles [flags] [args]
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo gen](/commands/hugo_gen/) - Generate documentation and syntax highlighting styles
|
||||
|
||||
|
||||
@@ -47,4 +47,3 @@ hugo gen doc [flags] [args]
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo gen](/commands/hugo_gen/) - Generate documentation and syntax highlighting styles
|
||||
|
||||
|
||||
@@ -44,4 +44,3 @@ hugo gen man [flags] [args]
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo gen](/commands/hugo_gen/) - Generate documentation and syntax highlighting styles
|
||||
|
||||
|
||||
@@ -5,11 +5,11 @@ url: /commands/hugo_import/
|
||||
---
|
||||
## hugo import
|
||||
|
||||
Import a site from another system
|
||||
Import a project from another system
|
||||
|
||||
### Synopsis
|
||||
|
||||
Import a site from another system.
|
||||
Import a project from another system.
|
||||
|
||||
Import requires a subcommand, e.g. `hugo import jekyll jekyll_root_path target_path`.
|
||||
|
||||
@@ -38,6 +38,5 @@ Import requires a subcommand, e.g. `hugo import jekyll jekyll_root_path target_p
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo](/commands/hugo/) - Build your site
|
||||
* [hugo](/commands/hugo/) - Build your project
|
||||
* [hugo import jekyll](/commands/hugo_import_jekyll/) - hugo import from Jekyll
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ hugo import from Jekyll
|
||||
### Synopsis
|
||||
|
||||
hugo import from Jekyll.
|
||||
|
||||
|
||||
Import from Jekyll requires two paths, e.g. `hugo import jekyll jekyll_root_path target_path`.
|
||||
|
||||
```
|
||||
@@ -43,5 +43,4 @@ hugo import jekyll [flags] [args]
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo import](/commands/hugo_import/) - Import a site from another system
|
||||
|
||||
* [hugo import](/commands/hugo_import/) - Import a project from another system
|
||||
|
||||
@@ -38,10 +38,9 @@ List requires a subcommand, e.g. hugo list drafts
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo](/commands/hugo/) - Build your site
|
||||
* [hugo](/commands/hugo/) - Build your project
|
||||
* [hugo list all](/commands/hugo_list_all/) - List all content
|
||||
* [hugo list drafts](/commands/hugo_list_drafts/) - List draft content
|
||||
* [hugo list expired](/commands/hugo_list_expired/) - List expired content
|
||||
* [hugo list future](/commands/hugo_list_future/) - List future content
|
||||
* [hugo list published](/commands/hugo_list_published/) - List published content
|
||||
|
||||
|
||||
@@ -41,4 +41,3 @@ hugo list all [flags] [args]
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo list](/commands/hugo_list/) - List content
|
||||
|
||||
|
||||
@@ -41,4 +41,3 @@ hugo list drafts [flags] [args]
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo list](/commands/hugo_list/) - List content
|
||||
|
||||
|
||||
@@ -41,4 +41,3 @@ hugo list expired [flags] [args]
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo list](/commands/hugo_list/) - List content
|
||||
|
||||
|
||||
@@ -41,4 +41,3 @@ hugo list future [flags] [args]
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo list](/commands/hugo_list/) - List content
|
||||
|
||||
|
||||
@@ -41,4 +41,3 @@ hugo list published [flags] [args]
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo list](/commands/hugo_list/) - List content
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ Most operations here requires a Go version installed on your system (>= Go 1.12)
|
||||
This is not needed if you only operate on modules inside /themes or if you have vendored them via "hugo mod vendor".
|
||||
|
||||
|
||||
Note that Hugo will always start out by resolving the components defined in the site
|
||||
Note that Hugo will always start out by resolving the components defined in the project
|
||||
configuration, provided by a _vendor directory (if no --ignoreVendorPaths flag provided),
|
||||
Go Modules, or a folder inside the themes directory, in that order.
|
||||
|
||||
@@ -47,7 +47,7 @@ See https://gohugo.io/hugo-modules/ for more information.
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo](/commands/hugo/) - Build your site
|
||||
* [hugo](/commands/hugo/) - Build your project
|
||||
* [hugo mod clean](/commands/hugo_mod_clean/) - Delete the Hugo Module cache for the current project
|
||||
* [hugo mod get](/commands/hugo_mod_get/) - Resolves dependencies in your current Hugo project
|
||||
* [hugo mod graph](/commands/hugo_mod_graph/) - Print a module dependency graph
|
||||
@@ -56,4 +56,3 @@ See https://gohugo.io/hugo-modules/ for more information.
|
||||
* [hugo mod tidy](/commands/hugo_mod_tidy/) - Remove unused entries in go.mod and go.sum
|
||||
* [hugo mod vendor](/commands/hugo_mod_vendor/) - Vendor all module dependencies into the _vendor directory
|
||||
* [hugo mod verify](/commands/hugo_mod_verify/) - Verify dependencies
|
||||
|
||||
|
||||
@@ -48,4 +48,3 @@ hugo mod clean [flags] [args]
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo mod](/commands/hugo_mod/) - Manage modules
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ Install the latest versions of all module dependencies (direct and indirect):
|
||||
|
||||
Run "go help get" for more information. All flags available for "go get" is also relevant here.
|
||||
|
||||
Note that Hugo will always start out by resolving the components defined in the site
|
||||
Note that Hugo will always start out by resolving the components defined in the project
|
||||
configuration, provided by a _vendor directory (if no --ignoreVendorPaths flag provided),
|
||||
Go Modules, or a folder inside the themes directory, in that order.
|
||||
|
||||
@@ -72,4 +72,3 @@ hugo mod get [flags] [args]
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo mod](/commands/hugo_mod/) - Manage modules
|
||||
|
||||
|
||||
@@ -49,4 +49,3 @@ hugo mod graph [flags] [args]
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo mod](/commands/hugo_mod/) - Manage modules
|
||||
|
||||
|
||||
@@ -53,4 +53,3 @@ hugo mod init [flags] [args]
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo mod](/commands/hugo_mod/) - Manage modules
|
||||
|
||||
|
||||
@@ -42,4 +42,3 @@ hugo mod npm [command] [flags]
|
||||
|
||||
* [hugo mod](/commands/hugo_mod/) - Manage modules
|
||||
* [hugo mod npm pack](/commands/hugo_mod_npm_pack/) - Experimental: Prepares and writes a composite package.json file for your project
|
||||
|
||||
|
||||
@@ -56,4 +56,3 @@ hugo mod npm pack [flags] [args]
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo mod npm](/commands/hugo_mod_npm/) - Various npm helpers
|
||||
|
||||
|
||||
@@ -42,4 +42,3 @@ hugo mod tidy [flags] [args]
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo mod](/commands/hugo_mod/) - Manage modules
|
||||
|
||||
|
||||
@@ -48,4 +48,3 @@ hugo mod vendor [flags] [args]
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo mod](/commands/hugo_mod/) - Manage modules
|
||||
|
||||
|
||||
@@ -47,4 +47,3 @@ hugo mod verify [flags] [args]
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo mod](/commands/hugo_mod/) - Manage modules
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@ It will guess which kind of file to create based on the path provided.
|
||||
|
||||
You can also specify the kind with `-k KIND`.
|
||||
|
||||
If archetypes are provided in your theme or site, they will be used.
|
||||
If archetypes are provided in your theme or project, they will be used.
|
||||
|
||||
Ensure you run this within the root directory of your site.
|
||||
Ensure you run this within the root directory of your project.
|
||||
|
||||
### Options
|
||||
|
||||
@@ -43,8 +43,7 @@ Ensure you run this within the root directory of your site.
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo](/commands/hugo/) - Build your site
|
||||
* [hugo](/commands/hugo/) - Build your project
|
||||
* [hugo new content](/commands/hugo_new_content/) - Create new content
|
||||
* [hugo new site](/commands/hugo_new_site/) - Create a new site
|
||||
* [hugo new project](/commands/hugo_new_project/) - Create a new project
|
||||
* [hugo new theme](/commands/hugo_new_theme/) - Create a new theme
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@ It will guess which kind of file to create based on the path provided.
|
||||
|
||||
You can also specify the kind with `-k KIND`.
|
||||
|
||||
If archetypes are provided in your theme or site, they will be used.
|
||||
If archetypes are provided in your theme or project, they will be used.
|
||||
|
||||
Ensure you run this within the root directory of your site.
|
||||
Ensure you run this within the root directory of your project.
|
||||
|
||||
```
|
||||
hugo new content [path] [flags]
|
||||
@@ -56,4 +56,3 @@ hugo new content [path] [flags]
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo new](/commands/hugo_new/) - Create new content
|
||||
|
||||
|
||||
+8
-9
@@ -1,18 +1,18 @@
|
||||
---
|
||||
title: "hugo new site"
|
||||
slug: hugo_new_site
|
||||
url: /commands/hugo_new_site/
|
||||
title: "hugo new project"
|
||||
slug: hugo_new_project
|
||||
url: /commands/hugo_new_project/
|
||||
---
|
||||
## hugo new site
|
||||
## hugo new project
|
||||
|
||||
Create a new site
|
||||
Create a new project
|
||||
|
||||
### Synopsis
|
||||
|
||||
Create a new site at the specified path.
|
||||
Create a new project at the specified path.
|
||||
|
||||
```
|
||||
hugo new site [path] [flags]
|
||||
hugo new project [path] [flags]
|
||||
```
|
||||
|
||||
### Options
|
||||
@@ -20,7 +20,7 @@ hugo new site [path] [flags]
|
||||
```
|
||||
-f, --force init inside non-empty directory
|
||||
--format string preferred file format (toml, yaml or json) (default "toml")
|
||||
-h, --help help for site
|
||||
-h, --help help for project
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
@@ -43,4 +43,3 @@ hugo new site [path] [flags]
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo new](/commands/hugo_new/) - Create new content
|
||||
|
||||
@@ -43,4 +43,3 @@ hugo new theme [name] [flags]
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo new](/commands/hugo_new/) - Create new content
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ Start the embedded web server
|
||||
|
||||
### Synopsis
|
||||
|
||||
Hugo provides its own webserver which builds and serves the site.
|
||||
Hugo provides its own webserver which builds and serves the project.
|
||||
While hugo server is high performance, it is a webserver with limited options.
|
||||
|
||||
The `hugo server` command will by default write and serve files from disk, but
|
||||
@@ -17,8 +17,8 @@ you can render to memory by using the `--renderToMemory` flag. This can be
|
||||
faster in some cases, but it will consume more memory.
|
||||
|
||||
By default hugo will also watch your files for any changes you make and
|
||||
automatically rebuild the site. It will then live reload any open browser pages
|
||||
and push the latest content to them. As most Hugo sites are built in a fraction
|
||||
automatically rebuild the project. It will then live reload any open browser pages
|
||||
and push the latest content to them. As most Hugo projects are built in a fraction
|
||||
of a second, you will be able to save and see your changes nearly instantly.
|
||||
|
||||
```
|
||||
@@ -53,7 +53,7 @@ hugo server [command] [flags]
|
||||
--noChmod don't sync permission mode of files
|
||||
--noHTTPCache prevent HTTP caching
|
||||
--noTimes don't sync modification time of files
|
||||
-O, --openBrowser open the site in a browser after server startup
|
||||
-O, --openBrowser open the project in a browser after server startup
|
||||
--panicOnWarning panic on first WARNING log
|
||||
--poll string set this to a poll interval, e.g --poll 700ms, to use a poll based approach to watch for file system changes
|
||||
-p, --port int port on which the server will listen (default 1313)
|
||||
@@ -93,6 +93,5 @@ hugo server [command] [flags]
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo](/commands/hugo/) - Build your site
|
||||
* [hugo](/commands/hugo/) - Build your project
|
||||
* [hugo server trust](/commands/hugo_server_trust/) - Install the local CA in the system trust store
|
||||
|
||||
|
||||
@@ -38,4 +38,3 @@ hugo server trust [flags] [args]
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo server](/commands/hugo_server/) - Start the embedded web server
|
||||
|
||||
|
||||
@@ -40,5 +40,4 @@ hugo version [flags] [args]
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [hugo](/commands/hugo/) - Build your site
|
||||
|
||||
* [hugo](/commands/hugo/) - Build your project
|
||||
|
||||
@@ -58,14 +58,14 @@ dataDir
|
||||
: (`string`) The designated directory for data files. Default is `data`. {{% module-mounts-note %}}
|
||||
|
||||
defaultContentLanguage
|
||||
: (`string`) The projects's default content language, conforming to the syntax described in [RFC 5646][]. This value must match one of the defined [language keys][]. Default is `en`.
|
||||
: (`string`) The projects's [default language](g), conforming to the syntax described in [RFC 5646][].
|
||||
|
||||
defaultContentLanguageInSubdir
|
||||
: (`bool`) Whether to publish the default content language to a subdirectory matching the [`defaultContentLanguage`][]. Default is `false`.
|
||||
|
||||
defaultContentRole
|
||||
: {{< new-in 0.153.0 />}}
|
||||
: (`string`) The project's default content [role](g). Default is `guest`.
|
||||
: (`string`) The project's [default role](g).
|
||||
|
||||
defaultContentRoleInSubdir
|
||||
: {{< new-in 0.153.0 />}}
|
||||
@@ -73,7 +73,7 @@ defaultContentRoleInSubdir
|
||||
|
||||
defaultContentVersion
|
||||
: {{< new-in 0.153.0 />}}
|
||||
: (`string`) The project's default content version. Default is `v1.0.0`.
|
||||
: (`string`) The project's [default version](g).
|
||||
|
||||
defaultContentVersionInSubdir
|
||||
: {{< new-in 0.153.0 />}}
|
||||
@@ -94,7 +94,7 @@ disableDefaultLanguageRedirect
|
||||
|
||||
disableDefaultSiteRedirect
|
||||
: {{< new-in 0.154.5 />}}
|
||||
: (bool) Whether to disable generation of the alias redirect to the [default site](g). When [`defaultContentLanguageInSubdir`][], [`defaultContentRoleInSubdir`][], or [`defaultContentVersionInSubdir`][] is `true`, this prevents the root directory from redirecting to the default site's subdirectory. Conversely, when these are `false`, it prevents the subdirectories from redirecting back to the root. The default site is the site with the default content language, version, and role. Default is `false`.
|
||||
: (bool) Whether to disable generation of the alias redirect to the [default site](g). When [`defaultContentLanguageInSubdir`][], [`defaultContentRoleInSubdir`][], or [`defaultContentVersionInSubdir`][] is `true`, this prevents the root directory from redirecting to the default site's subdirectory. Conversely, when these are `false`, it prevents the subdirectories from redirecting back to the root. Default is `false`.
|
||||
|
||||
disableHugoGeneratorInject
|
||||
: (`bool`) Whether to disable injection of a `<meta name="generator">` tag into the home page. Default is `false`.
|
||||
@@ -124,7 +124,7 @@ enableRobotsTXT
|
||||
: (`bool`) Whether to enable generation of a `robots.txt` file. Default is `false`.
|
||||
|
||||
environment
|
||||
: (`string`) The build environment. Default is `production` when running `hugo` and `development` when running `hugo server`.
|
||||
: (`string`) The build environment. Default is `production` when running `hugo build` and `development` when running `hugo server`.
|
||||
|
||||
frontmatter
|
||||
: See [configure front matter][].
|
||||
@@ -253,7 +253,7 @@ removePathAccents
|
||||
: (`bool`) Whether to remove [non-spacing marks][] from [composite characters][] in content paths. Default is `false`.
|
||||
|
||||
renderSegments
|
||||
: (`[]string`) A slice of [segments](g) to render. If omitted, all segments are rendered. This option is typically set via a command-line flag, such as `hugo --renderSegments segment1,segment2`. The provided segment names must correspond to those defined in the [`segments`][] configuration.
|
||||
: (`[]string`) A slice of [segments](g) to render. If omitted, all segments are rendered. This option is typically set via a command-line flag, such as `hugo build --renderSegments segment1,segment2`. The provided segment names must correspond to those defined in the [`segments`][] configuration.
|
||||
|
||||
resourceDir
|
||||
: (`string`) The designated directory for caching output from [asset pipelines](g). Default is `resources`.
|
||||
@@ -421,7 +421,6 @@ Some configuration settings, such as menus and custom parameters, can be defined
|
||||
[embedded Open Graph template]: <{{% eturl opengraph %}}>
|
||||
[embedded RSS template]: <{{% eturl rss %}}>
|
||||
[IANA Time Zone Database]: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
||||
[language keys]: /configuration/languages/#language-keys
|
||||
[module mounts]: /configuration/module/#mounts
|
||||
[non-spacing marks]: https://www.compart.com/en/unicode/category/Mn
|
||||
[os.UserCacheDir]: https://pkg.go.dev/os#UserCacheDir
|
||||
|
||||
@@ -78,6 +78,6 @@ disableClasses
|
||||
>
|
||||
> Built for speed, there may be "false positive" detections (e.g., HTML elements that are not HTML elements) while parsing the published site. These "false positives" are infrequent and inconsequential.
|
||||
|
||||
Due to the nature of partial server builds, new HTML entities are added while the server is running, but old values will not be removed until you restart the server or run a regular `hugo` build.
|
||||
Due to the nature of partial server builds, new HTML entities are added while the server is running, but old values will not be removed until you restart the server or run `hugo build`.
|
||||
|
||||
[`config/production`]: /configuration/introduction/#configuration-directory
|
||||
|
||||
@@ -46,13 +46,13 @@ maxAge
|
||||
: (`string`) The designated cache directory. See [details](/configuration/all/#cachedir).
|
||||
|
||||
`:project`
|
||||
: (`string`) The base directory name of the current Hugo project. This ensures isolated file caches for each project, preventing the `hugo --gc` command from affecting other projects on the same machine.
|
||||
: (`string`) The base directory name of the current Hugo project. This ensures isolated file caches for each project, preventing the `hugo build --gc` command from affecting other projects on the same machine.
|
||||
|
||||
`:resourceDir`
|
||||
: (`string`) The designated directory for caching output from [asset pipelines](g). See [details](/configuration/all/#resourcedir).
|
||||
|
||||
## Garbage collection
|
||||
|
||||
As you modify your site or change your configuration, cached files from previous builds may remain on disk, consuming unnecessary space. Use the `hugo --gc` command to remove these expired or unused entries from the file cache.
|
||||
As you modify your site or change your configuration, cached files from previous builds may remain on disk, consuming unnecessary space. Use the `hugo build --gc` command to remove these expired or unused entries from the file cache.
|
||||
|
||||
[`resources.GetRemote`]: /functions/resources/getremote/
|
||||
|
||||
@@ -21,9 +21,7 @@ color = 'red'
|
||||
## Target
|
||||
|
||||
<!-- TODO
|
||||
Update the <version> and <date> below when we actually get around to deprecating _target.
|
||||
|
||||
We deprecated the `_target` front matter key in favor of `target` in <version> on <date>. Remove footnote #1 on or after 2027-05-01 (15 months after deprecation).
|
||||
We deprecated the `_target` front matter key in favor of `target` in v0.156.0 on 2026-02-17. Remove footnote #1 on or after 2027-05-17 (15 months after deprecation).
|
||||
-->
|
||||
|
||||
The `target`[^1] keyword allows you to target specific pages or [environments](g). For example, to cascade a "color" parameter to pages within the "articles" section, including the "articles" section page itself:
|
||||
|
||||
@@ -76,16 +76,16 @@ Hugo provides the following [tokens](g) to help you configure your front matter:
|
||||
|
||||
Within the `YYYY-MM-DD-HH-MM-SS` format, the date and time values may be separated by any character including a space (e.g., `2025-02-01T14-30-00`).
|
||||
|
||||
Hugo resolves the extracted date to the [`timeZone`] defined in your site configuration, falling back to the system time zone. After extracting the date, Hugo uses the remaining part of the file name to generate the page's [`slug`], but only if you haven't already specified a slug in the page's front matter.
|
||||
Hugo resolves the extracted date to the [`timeZone`] defined in your project configuration, falling back to the system time zone. After extracting the date, Hugo uses the remaining part of the file name to generate the page's [`slug`], but only if you haven't already specified a slug in the page's front matter.
|
||||
|
||||
For example, if you name your file `2025-02-01-article.md`, Hugo will set the date to `2025-02-01` and the slug to `article`.
|
||||
|
||||
`:git`
|
||||
: The Git author date for the file's last revision. To enable access to the Git author date, set [`enableGitInfo`] to `true`, or use the `--enableGitInfo` flag when building your site.
|
||||
: The Git author date for the file's last revision. To enable access to the Git author date, set [`enableGitInfo`] to `true`, or use the `--enableGitInfo` flag when building your project.
|
||||
|
||||
## Example
|
||||
|
||||
Consider this site configuration:
|
||||
Consider this project configuration:
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
[frontmatter]
|
||||
|
||||
@@ -23,7 +23,7 @@ Only define settings that deviate from the defaults. A smaller configuration fil
|
||||
|
||||
## Configuration file
|
||||
|
||||
Create a site configuration file in the root of your project directory, naming it `hugo.toml`, `hugo.yaml`, or `hugo.json`, with that order of precedence.
|
||||
Create a project configuration file in the root of your project directory, naming it `hugo.toml`, `hugo.yaml`, or `hugo.json`, with that order of precedence.
|
||||
|
||||
```text
|
||||
my-project/
|
||||
@@ -31,7 +31,7 @@ my-project/
|
||||
```
|
||||
|
||||
> [!note]
|
||||
> For versions v0.109.0 and earlier, the site configuration file was named `config`. While you can still use this name, it's recommended to switch to the newer naming convention, `hugo`.
|
||||
> For versions v0.109.0 and earlier, the project configuration file was named `config`. While you can still use this name, it's recommended to switch to the newer naming convention, `hugo`.
|
||||
|
||||
A simple example:
|
||||
|
||||
@@ -46,16 +46,16 @@ email = 'info@example.org'
|
||||
phone = '+1 202-555-1212'
|
||||
{{< /code-toggle >}}
|
||||
|
||||
To use a different configuration file when building your site, use the `--config` flag:
|
||||
To use a different configuration file when building your project, use the `--config` flag:
|
||||
|
||||
```sh
|
||||
hugo --config other.toml
|
||||
hugo build --config other.toml
|
||||
```
|
||||
|
||||
Combine two or more configuration files, with left-to-right precedence:
|
||||
|
||||
```sh
|
||||
hugo --config a.toml,b.yaml,c.json
|
||||
hugo build --config a.toml,b.yaml,c.json
|
||||
```
|
||||
|
||||
> [!note]
|
||||
@@ -63,7 +63,7 @@ hugo --config a.toml,b.yaml,c.json
|
||||
|
||||
## Configuration directory
|
||||
|
||||
Instead of a single site configuration file, split your configuration by [environment](g), root configuration key, and language. For example:
|
||||
Instead of a single project configuration file, split your configuration by [environment](g), root configuration key, and language. For example:
|
||||
|
||||
```text
|
||||
my-project/
|
||||
@@ -129,9 +129,9 @@ my-project/
|
||||
└── params.toml
|
||||
```
|
||||
|
||||
Considering the structure above, when running `hugo --environment staging`, Hugo will use every setting from `config/_default` and merge `staging`'s on top of those.
|
||||
Considering the structure above, when running `hugo build --environment staging`, Hugo will use every setting from `config/_default` and merge `staging`'s on top of those.
|
||||
|
||||
Let's take an example to understand this better. Let's say you are using Google Analytics for your website. This requires you to specify a [Google tag ID] in your site configuration:
|
||||
Let's take an example to understand this better. Let's say you are using Google Analytics for your website. This requires you to specify a [Google tag ID] in your project configuration:
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
[services.googleAnalytics]
|
||||
@@ -159,7 +159,7 @@ To satisfy these requirements, configure your site as follows:
|
||||
{{< /code-toggle >}}
|
||||
|
||||
- You do not need to include other parameters in this file. Include only those parameters that are specific to your production environment. Hugo will merge these parameters with the default configuration.
|
||||
- By default, Hugo sets its `environment` to `production` when running `hugo`. The analytics code will use the `G-PPPPPPPPP` tag ID.
|
||||
- By default, Hugo sets its `environment` to `production` when running `hugo build`. The analytics code will use the `G-PPPPPPPPP` tag ID.
|
||||
|
||||
1. `config/staging/hugo.toml`
|
||||
|
||||
@@ -171,7 +171,7 @@ To satisfy these requirements, configure your site as follows:
|
||||
{{< /code-toggle >}}
|
||||
|
||||
- You do not need to include other parameters in this file. Include only those parameters that are specific to your staging environment. Hugo will merge these parameters with the default configuration.
|
||||
- To build your staging site, run `hugo --environment staging`. The analytics code will use the `G-SSSSSSSSS` tag ID.
|
||||
- To build your staging site, run `hugo build --environment staging`. The analytics code will use the `G-SSSSSSSSS` tag ID.
|
||||
|
||||
## Merge configuration settings
|
||||
|
||||
@@ -253,14 +253,14 @@ HUGO_FILE_LOG_FORMAT
|
||||
: (`string`) A format string for the file path, line number, and column number displayed when reporting errors, or when calling the `Position` method from a shortcode or Markdown render hook. Valid tokens are `:file`, `:line`, and `:col`. Default is `:file::line::col`.
|
||||
|
||||
HUGO_MEMORYLIMIT
|
||||
: (`int`) The maximum amount of system memory, in gigabytes, that Hugo can use while rendering your site. Default is 25% of total system memory. Note that `HUGO_MEMORYLIMIT` is a "best effort" setting. Don't expect Hugo to build a million pages with only 1 GB of memory. You can get more information about how this behaves during the build by building with `hugo --logLevel info` and look for the `dynacache` label.
|
||||
: (`int`) The maximum amount of system memory, in gigabytes, that Hugo can use while rendering your site. Default is 25% of total system memory. Note that `HUGO_MEMORYLIMIT` is a "best effort" setting. Don't expect Hugo to build a million pages with only 1 GB of memory. You can get more information about how this behaves during the build by running `hugo build --logLevel info` and look for the `dynacache` label.
|
||||
|
||||
HUGO_NUMWORKERMULTIPLIER
|
||||
: (`int`) The number of workers used in parallel processing. Default is the number of logical CPUs.
|
||||
|
||||
## Current configuration
|
||||
|
||||
Display the complete site configuration with:
|
||||
Display the complete project configuration with:
|
||||
|
||||
```sh
|
||||
hugo config
|
||||
|
||||
@@ -56,7 +56,7 @@ languageCode
|
||||
Access this value from a template using the [`Language.LanguageCode`][] method on a `Site` or `Page` object.
|
||||
|
||||
languageDirection
|
||||
: (`string`) The language direction, either left-to-right (`ltr`) or right-to-left (`rtl`). Use this value in your templates with the global [`dir`][] HTML attribute. Access this value from a template using the [`Language.LanguageDirection`][] method on a `Site` or `Page` object.
|
||||
: (`string`) The language direction, either left-to-right (`ltr`) or right-to-left (`rtl`). Use this value in your templates with the global [`dir`][] HTML attribute. Access this value from a template using the [`Language.LanguageDirection`][] method on a `Site` or `Page` object. Default is `ltr`.
|
||||
|
||||
languageName
|
||||
: (`string`) The language name, typically used when rendering a language switcher. Access this value from a template using the [`Language.LanguageName`][] method on a `Site` or `Page` object.
|
||||
@@ -67,6 +67,10 @@ title
|
||||
weight
|
||||
: (`int`) The language [weight](g). When set to a non-zero value, this is the primary sort criteria for this language. Access this value from a template using the [`Language.Weight`][] method on a `Site` or `Page` object.
|
||||
|
||||
## Sort order
|
||||
|
||||
Hugo sorts languages by weight in ascending order, then lexicographically in ascending order. This affects build order and complement selection.
|
||||
|
||||
## Localized settings
|
||||
|
||||
Some configuration settings can be defined separately for each language. For example:
|
||||
@@ -88,7 +92,7 @@ The following configuration keys can be defined separately for each language:
|
||||
|
||||
{{< per-lang-config-keys >}}
|
||||
|
||||
Any key not defined in a `languages` object will fall back to the global value in the root of the site configuration.
|
||||
Any key not defined in a `languages` object will fall back to the global value in the root of your project configuration.
|
||||
|
||||
## Language keys
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ defaultMarkdownHandler = 'goldmark'
|
||||
|
||||
Files with ending with `.md`, `.mdown`, or `.markdown` are processed as Markdown, unless you've explicitly set a different format using the `markup` field in your front matter.
|
||||
|
||||
To use a different renderer for Markdown files, specify one of `asciidocext`, `org`, `pandoc`, or `rst` in your site configuration.
|
||||
To use a different renderer for Markdown files, specify one of `asciidocext`, `org`, `pandoc`, or `rst` in your project configuration.
|
||||
|
||||
`defaultMarkdownHandler`|Renderer
|
||||
:--|:--
|
||||
@@ -58,8 +58,6 @@ Extension|Documentation|Enabled
|
||||
|
||||
#### Extras
|
||||
|
||||
{{< new-in 0.126.0 />}}
|
||||
|
||||
Enable [deleted text], [inserted text], [mark text], [subscript], and [superscript] elements in Markdown.
|
||||
|
||||
Element|Markdown|Rendered
|
||||
@@ -257,7 +255,7 @@ workingFolderCurrent
|
||||
Follow the steps below to enable syntax highlighting.
|
||||
|
||||
Step 1
|
||||
: Set the `source-highlighter` attribute in your site configuration. For example:
|
||||
: Set the `source-highlighter` attribute in your project configuration. For example:
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
[markup.asciidocExt.attributes]
|
||||
@@ -300,7 +298,7 @@ Step 4
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
Run `hugo --logLevel debug` to examine Hugo's call to the Asciidoctor executable:
|
||||
Run `hugo build --logLevel debug` to examine Hugo's call to the Asciidoctor executable:
|
||||
|
||||
```txt
|
||||
INFO 2019/12/22 09:08:48 Rendering book-as-pdf.adoc with C:\Ruby26-x64\bin\asciidoctor.bat using asciidoc args [--no-header-footer -r asciidoctor-html5s -b html5s -r asciidoctor-diagram --base-dir D:\prototypes\hugo_asciidoc_ddd\docs -a outdir=D:\prototypes\hugo_asciidoc_ddd\build -] ...
|
||||
|
||||
@@ -12,10 +12,10 @@ keywords: []
|
||||
There are three ways to define menu entries:
|
||||
|
||||
1. [Automatically]
|
||||
1. [In front matter]
|
||||
1. In site configuration
|
||||
1. In [front matter]
|
||||
1. In your project configuration
|
||||
|
||||
This page covers the site configuration method.
|
||||
This page covers the project configuration method.
|
||||
|
||||
## Example
|
||||
|
||||
@@ -132,6 +132,6 @@ rel = 'external'
|
||||
|
||||
[`Menus`]: /methods/site/menus/
|
||||
[Automatically]: /content-management/menus/#define-automatically
|
||||
[In front matter]: /content-management/menus/#define-in-front-matter
|
||||
[front matter]: /content-management/menus/#define-in-front-matter
|
||||
[menu templates]: /templates/menu/
|
||||
[menus]: /content-management/menus/
|
||||
|
||||
@@ -53,7 +53,7 @@ notAlternative
|
||||
: (`bool`) Whether to exclude this output format from the values returned by the [`AlternativeOutputFormats`][] method on a `Page` object. Default is `false`.
|
||||
|
||||
noUgly
|
||||
: (`bool`) Whether to disable ugly URLs for this output format when [`uglyURLs`][] are enabled in your site configuration. Default is `false`.
|
||||
: (`bool`) Whether to disable ugly URLs for this output format when [`uglyURLs`][] are enabled in your project configuration. Default is `false`.
|
||||
|
||||
path
|
||||
: (`string`) The first segment of the publication path for this output format. This path segment is relative to the root of your [`publishDir`][]. If omitted, Hugo will use the file's original content path for publishing.
|
||||
@@ -62,7 +62,7 @@ permalinkable
|
||||
: (`bool`) Whether to return the rendering output format rather than the main output format when invoking the [`Permalink`][] and [`RelPermalink`][] methods on a `Page` object. Along with [`isHTML`](#ishtml), this must be `true` to create [alias redirects][]. Enabled by default for the `html` and `amp` output formats. Default is `false`.
|
||||
|
||||
protocol
|
||||
: (`string`) The protocol (scheme) of the URL for this output format. For example, `https://` or `webcal://`. Default is the scheme of the [`baseURL`][] parameter in your site configuration, typically `https://`.
|
||||
: (`string`) The protocol (scheme) of the URL for this output format. For example, `https://` or `webcal://`. Default is the scheme of the [`baseURL`][] parameter in your project configuration, typically `https://`.
|
||||
|
||||
rel
|
||||
: (`string`) The relationship of the output format to the current page. Hugo uses this property to determine the [canonical output format](g) of the current page. For the predefined `html` output format, the default value is `canonical`; for all other predefined output formats, the default value is `alternate`.
|
||||
@@ -71,7 +71,7 @@ root
|
||||
: (`bool`) Whether to publish files to the root of the publish directory. Default is `false`.
|
||||
|
||||
ugly
|
||||
: (`bool`) Whether to enable uglyURLs for this output format when `uglyURLs` is `false` in your site configuration. Default is `false`.
|
||||
: (`bool`) Whether to enable uglyURLs for this output format when `uglyURLs` is `false` in your project configuration. Default is `false`.
|
||||
|
||||
weight
|
||||
: (`int`) When set to a non-zero value, Hugo uses the `weight` as the first criteria when sorting output formats, falling back to the name of the output format. Lighter items float to the top, while heavier items sink to the bottom. Hugo renders output formats sequentially based on the sort order. Default is `0`, except for the `html` output format, which has a default weight of `10`.
|
||||
@@ -138,7 +138,7 @@ Step 4
|
||||
|
||||
## List output formats
|
||||
|
||||
To access output formats, each `Page` object provides two methods: [`OutputFormats`][] (for all formats, including the current one) and [`AlternativeOutputFormats`][]. Use `AlternativeOutputFormats` to create a link `rel` list within your site's `head` element, as shown below:
|
||||
To access output formats, each `Page` object provides two methods: [`OutputFormats`][] (for all formats, including the current one) and [`AlternativeOutputFormats`][]. Use `AlternativeOutputFormats` to create a link `rel` list within a `head` element, as shown below:
|
||||
|
||||
```go-html-template
|
||||
{{ range .AlternativeOutputFormats }}
|
||||
|
||||
@@ -41,7 +41,7 @@ title = 'Example'
|
||||
outputs = ['json']
|
||||
{{< /code-toggle >}}
|
||||
|
||||
In its default configuration, Hugo will render both the `html` and `json` output formats for this page. The `outputs` field appends to, rather than replaces, the site's configured outputs.
|
||||
In its default configuration, Hugo will render both the `html` and `json` output formats for this page. The `outputs` field appends to, rather than replaces, the project's configured outputs.
|
||||
|
||||
[`Permalink`]: /methods/page/permalink/
|
||||
[`RelPermalink`]: /methods/page/relpermalink/
|
||||
|
||||
@@ -15,7 +15,7 @@ Hugo uses the default sort order to determine the _next_ and _previous_ page rel
|
||||
- [`Next`](/methods/page/next/) and [`Prev`](/methods/page/prev/)
|
||||
- [`NextInSection`](/methods/page/nextinsection/) and [`PrevInSection`](/methods/page/previnsection/)
|
||||
|
||||
This is based on this default site configuration:
|
||||
This is based on this default project configuration:
|
||||
|
||||
{{< code-toggle config=page />}}
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ content/
|
||||
└── _index.md
|
||||
```
|
||||
|
||||
And this site configuration:
|
||||
And this project configuration:
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
defaultContentLanguage = 'en'
|
||||
|
||||
@@ -9,7 +9,7 @@ keywords: []
|
||||
> [!note]
|
||||
> To understand Hugo's related content identification, please refer to the [related content] page.
|
||||
|
||||
Hugo provides a sensible default configuration for identifying related content, but you can customize it in your site configuration, either globally or per language.
|
||||
Hugo provides a sensible default configuration for identifying related content, but you can customize it in your project configuration, either globally or per language.
|
||||
|
||||
## Default configuration
|
||||
|
||||
@@ -18,7 +18,7 @@ This is the default configuration:
|
||||
{{< code-toggle config=related />}}
|
||||
|
||||
> [!note]
|
||||
> Adding a `related` section to your site configuration requires you to provide a full configuration. You cannot override individual default values without specifying all related settings.
|
||||
> Adding a `related` section to your project configuration requires you to provide a full configuration. You cannot override individual default values without specifying all related settings.
|
||||
|
||||
## Top-level options
|
||||
|
||||
|
||||
@@ -12,7 +12,20 @@ This is the default configuration:
|
||||
|
||||
{{< code-toggle config=roles />}}
|
||||
|
||||
To define "guest" and "member" roles:
|
||||
## Settings
|
||||
|
||||
Use the following setting to define how Hugo orders roles.
|
||||
|
||||
weight
|
||||
: (`int`) The role [weight](g).
|
||||
|
||||
## Sort order
|
||||
|
||||
Hugo sorts roles by weight in ascending order, then lexicographically in ascending order. This affects build order and complement selection.
|
||||
|
||||
## Example
|
||||
|
||||
The following configuration demonstrates how to define multiple roles with specific weights.
|
||||
|
||||
{{< code-toggle >}}
|
||||
[roles.guest]
|
||||
@@ -20,5 +33,3 @@ weight = 20
|
||||
[roles.member]
|
||||
weight = 10
|
||||
{{< /code-toggle >}}
|
||||
|
||||
Roles are sorted by their [weight](g) in descending order, then by their name in descending order. This affects build order and complement selection.
|
||||
|
||||
@@ -36,7 +36,7 @@ http.urls
|
||||
> [!note]
|
||||
> Setting an allowlist to the string `none` will completely disable the associated feature.
|
||||
|
||||
You can also override the site configuration with environment variables. For example, to block `resources.GetRemote` from accessing any URL:
|
||||
You can also override your project configuration with environment variables. For example, to block `resources.GetRemote` from accessing any URL:
|
||||
|
||||
```txt
|
||||
export HUGO_SECURITY_HTTP_URLS=none
|
||||
|
||||
@@ -62,14 +62,14 @@ Place broad filters, such as those for language or output format, in the exclude
|
||||
|
||||
Render specific segments using the [`renderSegments`] configuration or the `--renderSegments` flag:
|
||||
|
||||
```bash
|
||||
hugo --renderSegments segment1
|
||||
```sh
|
||||
hugo build --renderSegments segment1
|
||||
```
|
||||
|
||||
You can configure multiple segments and use a comma-separated list with `--renderSegments` to render them all.
|
||||
|
||||
```bash
|
||||
hugo --renderSegments segment1,segment2
|
||||
```sh
|
||||
hugo build --renderSegments segment1,segment2
|
||||
```
|
||||
|
||||
[`renderSegments`]: /configuration/all/#rendersegments
|
||||
|
||||
@@ -56,7 +56,7 @@ taxonomies:
|
||||
tag: tags
|
||||
{{< /code-toggle >}}
|
||||
|
||||
To disable the taxonomy system, use the [`disableKinds`] setting in the root of your site configuration to disable the `taxonomy` and `term` page [kinds](g).
|
||||
To disable the taxonomy system, use the [`disableKinds`] setting in the root of your project configuration to disable the `taxonomy` and `term` page [kinds](g).
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
disableKinds = ['taxonomy','term']
|
||||
|
||||
@@ -12,15 +12,26 @@ This is the default configuration:
|
||||
|
||||
{{< code-toggle config=versions />}}
|
||||
|
||||
To define "v1.0.0" and "v2.0.0" versions:
|
||||
## Settings
|
||||
|
||||
Use the following setting to define how Hugo orders versions.
|
||||
|
||||
weight
|
||||
: (`int`) The language [weight](g).
|
||||
|
||||
## Sort order
|
||||
|
||||
Hugo sorts versions by weight in ascending order, then by their [semantic version][] in descending order. This affects build order and complement selection.
|
||||
|
||||
## Example
|
||||
|
||||
The following configuration demonstrates how to define multiple versions with specific weights.
|
||||
|
||||
{{< code-toggle >}}
|
||||
[versions."v1.0.0"]
|
||||
weight = 0
|
||||
weight = 20
|
||||
[versions."v2.0.0"]
|
||||
weight = 0
|
||||
weight = 10
|
||||
{{< /code-toggle >}}
|
||||
|
||||
Versions are sorted by their [weight](g) in ascending order, then by their [semantic version] in descending order. This affects build order and complement selection.
|
||||
|
||||
[semantic version]: https://semver.org/
|
||||
|
||||
@@ -16,7 +16,7 @@ Hugo comes with all the code you need to load Disqus into your templates. Before
|
||||
|
||||
### Configure Disqus
|
||||
|
||||
Disqus comments require you set a single value in your [site's configuration file][configuration] like so:
|
||||
Disqus comments require you set a single value in your [project configuration][configuration]:
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
[services.disqus]
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
---
|
||||
title: Content adapters
|
||||
description: Create content adapters to dynamically add content when building your site.
|
||||
description: Create content adapters to dynamically add content when building your project.
|
||||
categories: []
|
||||
keywords: []
|
||||
---
|
||||
|
||||
{{< new-in 0.126.0 />}}
|
||||
|
||||
## Overview
|
||||
|
||||
A content adapter is a template that dynamically creates pages when building a site. For example, use a content adapter to create pages from a remote data source such as JSON, TOML, YAML, or XML.
|
||||
@@ -120,7 +118,7 @@ For more fine-grained control, define a `sites.matrix` in front matter or in a c
|
||||
|
||||
### EnableAllDimensions
|
||||
|
||||
By default, Hugo executes the content adapter only once for the first matching site in the [sites matrix](g). Use this method to expand execution to every possible combination of language, role, and version.
|
||||
By default, Hugo executes the content adapter only once for the first matching site in the [sites matrix](g). Use this method to expand execution to every possible combination of language, version, and role.
|
||||
|
||||
For more fine-grained control, define a `sites.matrix` in front matter or in a content mount.
|
||||
|
||||
@@ -284,7 +282,7 @@ With multilingual sites you can:
|
||||
|
||||
### Translations by file name
|
||||
|
||||
With this site configuration:
|
||||
With this project configuration:
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
[languages.en]
|
||||
@@ -307,7 +305,7 @@ content/
|
||||
|
||||
### Translations by content directory
|
||||
|
||||
With this site configuration:
|
||||
With this project configuration:
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
[languages.en]
|
||||
@@ -347,7 +345,7 @@ content/
|
||||
|
||||
If the content adapter also creates `books/the-hunchback-of-notre-dame`, the content of the published page is indeterminate. You can not define the processing order.
|
||||
|
||||
To detect page collisions, use the `--printPathWarnings` flag when building your site.
|
||||
To detect page collisions, use the `--printPathWarnings` flag when building your project.
|
||||
|
||||
[content formats]: /content-management/formats/#classification
|
||||
[front matter field]: /content-management/front-matter/#fields
|
||||
|
||||
@@ -34,7 +34,7 @@ Hugo selects the content renderer based on the `markup` identifier in front matt
|
||||
|
||||
Create your content in [Markdown] preceded by front matter.
|
||||
|
||||
Markdown is Hugo's default content format. Hugo natively renders Markdown to HTML using [Goldmark]. Goldmark is fast and conforms to the [CommonMark] and [GitHub Flavored Markdown] specifications. You can configure Goldmark in your [site configuration][configure goldmark].
|
||||
Markdown is Hugo's default content format. Hugo natively renders Markdown to HTML using [Goldmark]. Goldmark is fast and conforms to the [CommonMark] and [GitHub Flavored Markdown] specifications. You can configure Goldmark in your [project configuration][configure goldmark].
|
||||
|
||||
Hugo provides custom Markdown features including:
|
||||
|
||||
@@ -77,7 +77,7 @@ Create your content in the [Emacs Org Mode] format preceded by front matter. You
|
||||
|
||||
Create your content in the [AsciiDoc] format preceded by front matter. Hugo renders AsciiDoc content to HTML using the Asciidoctor executable. You must install Asciidoctor and its dependencies (Ruby) to render the AsciiDoc content format.
|
||||
|
||||
You can configure the AsciiDoc renderer in your [site configuration][configure asciidoc].
|
||||
You can configure the AsciiDoc renderer in your [project configuration][configure asciidoc].
|
||||
|
||||
In its default configuration, Hugo passes these CLI flags when calling the Asciidoctor executable:
|
||||
|
||||
@@ -85,10 +85,10 @@ In its default configuration, Hugo passes these CLI flags when calling the Ascii
|
||||
--no-header-footer
|
||||
```
|
||||
|
||||
The CLI flags passed to the Asciidoctor executable depend on configuration. You may inspect the flags when building your site:
|
||||
The CLI flags passed to the Asciidoctor executable depend on configuration. You may inspect the flags when building your project:
|
||||
|
||||
```text
|
||||
hugo --logLevel info
|
||||
hugo build --logLevel info
|
||||
```
|
||||
|
||||
[AsciiDoc]: https://asciidoc.org/
|
||||
|
||||
@@ -178,7 +178,7 @@ The embedded templates will skip a parameter if not provided in front matter, bu
|
||||
|
||||
## Taxonomies
|
||||
|
||||
Classify content by adding taxonomy terms to front matter. For example, with this site configuration:
|
||||
Classify content by adding taxonomy terms to front matter. For example, with this project configuration:
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
[taxonomies]
|
||||
@@ -240,9 +240,7 @@ From Hugo 0.153.0, you can also set the [sites](#sites) front matter as cascade
|
||||
### Target
|
||||
|
||||
<!-- TODO
|
||||
Update the <version> and <date> below when we actually get around to deprecating _target.
|
||||
|
||||
We deprecated the `_target` front matter key in favor of `target` in <version> on <date>. Remove footnote #1 on or after 2027-05-01 (15 months after deprecation).
|
||||
We deprecated the `_target` front matter key in favor of `target` in v0.156.0 on 2026-02-17. Remove footnote #1 on or after 2027-05-17 (15 months after deprecation).
|
||||
-->
|
||||
|
||||
The `target`[^1] keyword allows you to target specific pages or [environments](g). For example, to cascade a "color" parameter from the home page only to pages within the "articles" section, including the "articles" section page itself:
|
||||
@@ -295,7 +293,7 @@ kind = 'page'
|
||||
{{< /code-toggle >}}
|
||||
|
||||
> [!note]
|
||||
> For multilingual sites, defining cascade values in your site configuration is often more efficient. This avoids repeating the same cascade values on the home, section, taxonomy, or term page for each language. See [details](/configuration/cascade/).
|
||||
> For multilingual sites, defining cascade values in your project configuration is often more efficient. This avoids repeating the same cascade values on the home, section, taxonomy, or term page for each language. See [details](/configuration/cascade/).
|
||||
>
|
||||
> If you choose to define cascade values in front matter for a multilingual site, you must create a corresponding home, section, taxonomy, or term page for every language.
|
||||
|
||||
@@ -330,10 +328,10 @@ When populating a date field, whether a [custom page parameter](#parameters) or
|
||||
|
||||
{{% include "/_common/parsable-date-time-strings.md" %}}
|
||||
|
||||
To override the default time zone, set the [`timeZone`](/configuration/all/#timezone) in your site configuration. The order of precedence for determining the time zone is:
|
||||
To override the default time zone, set the [`timeZone`](/configuration/all/#timezone) in your project configuration. The order of precedence for determining the time zone is:
|
||||
|
||||
1. The time zone offset in the date/time string
|
||||
1. The time zone specified in your site configuration
|
||||
1. The time zone specified in your project configuration
|
||||
1. The `Etc/UTC` time zone
|
||||
|
||||
[`aliases`]: /methods/page/aliases/
|
||||
|
||||
@@ -134,9 +134,9 @@ Select a method from the table above for syntax and usage examples.
|
||||
|
||||
### Caching
|
||||
|
||||
Hugo processes images on demand and returns a new resource object. To ensure subsequent builds remain fast, Hugo caches the results in the directory specified in the [file cache] section of your site configuration.
|
||||
Hugo processes images on demand and returns a new resource object. To ensure subsequent builds remain fast, Hugo caches the results in the directory specified in the [file cache][] section of your project configuration.
|
||||
|
||||
If you host your site with Netlify, include the following in your site configuration to persist the image cache between builds:
|
||||
If you host your site with Netlify, include the following in your project configuration to persist the image cache between builds:
|
||||
|
||||
```toml
|
||||
[caches]
|
||||
@@ -149,7 +149,7 @@ If you host your site with Netlify, include the following in your site configura
|
||||
If you change image processing methods, or rename/remove images, the cache will eventually contain unused files. To remove them and reclaim disk space, run Hugo's garbage collection:
|
||||
|
||||
```text
|
||||
hugo --gc
|
||||
hugo build --gc
|
||||
```
|
||||
|
||||
### Resource usage
|
||||
@@ -175,3 +175,4 @@ See [configure imaging](/configuration/imaging).
|
||||
[`RelPermalink`]: /methods/resource/relpermalink/
|
||||
[`Resize`]: /methods/resource/resize/
|
||||
[`Width`]: /methods/resource/width/
|
||||
[file cache]: /configuration/caches/
|
||||
|
||||
@@ -38,7 +38,7 @@ With `class` and `id` attributes, whether you use long-form or short-form notati
|
||||
|
||||
## Block elements
|
||||
|
||||
Update your site configuration to enable Markdown attributes for block-level elements.
|
||||
Update your project configuration to enable Markdown attributes for block-level elements.
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
[markup.goldmark.parser.attribute]
|
||||
@@ -103,7 +103,7 @@ For example:
|
||||
````text
|
||||
## Section 1 {class=foo}
|
||||
|
||||
```bash {class=foo linenos=inline}
|
||||
```sh {class=foo linenos=inline}
|
||||
declare a=1
|
||||
echo "${a}"
|
||||
```
|
||||
|
||||
@@ -35,7 +35,7 @@ Equations and expressions can be displayed inline with other text, or as standal
|
||||
Whether an equation or expression appears inline, or as a block, depends on the delimiters that surround the mathematical markup. Delimiters are defined in pairs, where each pair consists of an opening and closing delimiter. The opening and closing delimiters may be the same, or different.
|
||||
|
||||
> [!note]
|
||||
> You can configure Hugo to render mathematical markup on the client side using the MathJax or KaTeX display engine, or you can render the markup with the [`transform.ToMath`][] function while building your site.
|
||||
> You can configure Hugo to render mathematical markup on the client side using the MathJax or KaTeX display engine, or you can render the markup with the [`transform.ToMath`][] function while building your project.
|
||||
>
|
||||
> The first approach is described below.
|
||||
|
||||
@@ -44,7 +44,7 @@ Whether an equation or expression appears inline, or as a block, depends on the
|
||||
Follow these instructions to include mathematical equations and expressions in your Markdown using LaTeX markup.
|
||||
|
||||
Step 1
|
||||
: Enable and configure the Goldmark [passthrough extension][] in your site configuration. The passthrough extension preserves raw Markdown within delimited snippets of text, including the delimiters themselves.
|
||||
: Enable and configure the Goldmark [passthrough extension][] in your project configuration. The passthrough extension preserves raw Markdown within delimited snippets of text, including the delimiters themselves.
|
||||
|
||||
{{< code-toggle file=hugo copy=true >}}
|
||||
[markup.goldmark.extensions.passthrough]
|
||||
@@ -58,7 +58,7 @@ Step 1
|
||||
math = true
|
||||
{{< /code-toggle >}}
|
||||
|
||||
The configuration above enables mathematical rendering on every page unless you set the `math` parameter to `false` in front matter. To enable mathematical rendering as needed, set the `math` parameter to `false` in your site configuration, and set the `math` parameter to `true` in front matter. Use this parameter in your base template as shown in [Step 3][].
|
||||
The configuration above enables mathematical rendering on every page unless you set the `math` parameter to `false` in front matter. To enable mathematical rendering as needed, set the `math` parameter to `false` in your project configuration, and set the `math` parameter to `true` in front matter. Use this parameter in your base template as shown in [Step 3][].
|
||||
|
||||
> [!note]
|
||||
> The configuration above precludes the use of the `$...$` delimiter pair for inline equations. Although you can add this delimiter pair to the configuration and JavaScript, you must double-escape the `$` symbol when used outside of math contexts to avoid unintended formatting.
|
||||
@@ -99,7 +99,7 @@ Step 2
|
||||
</script>
|
||||
```
|
||||
|
||||
The delimiters above must match the delimiters in your site configuration.
|
||||
The delimiters above must match the delimiters in your project configuration.
|
||||
|
||||
Step 3
|
||||
: Conditionally call the _partial_ template from the base template.
|
||||
@@ -114,10 +114,10 @@ Step 3
|
||||
</head>
|
||||
```
|
||||
|
||||
The example above loads the _partial_ template if you have set the `math` parameter in front matter to `true`. If you have not set the `math` parameter in front matter, the conditional statement falls back to the `math` parameter in your site configuration.
|
||||
The example above loads the _partial_ template if you have set the `math` parameter in front matter to `true`. If you have not set the `math` parameter in front matter, the conditional statement falls back to the `math` parameter in your project configuration.
|
||||
|
||||
Step 4
|
||||
: If you set the `math` parameter to `false` in your site configuration, you must set the `math` parameter to `true` in front matter. For example:
|
||||
: If you set the `math` parameter to `false` in your project configuration, you must set the `math` parameter to `true` in front matter. For example:
|
||||
|
||||
{{< code-toggle file=content/math-examples.md fm=true >}}
|
||||
title = 'Math examples'
|
||||
@@ -211,7 +211,7 @@ To use KaTeX instead of MathJax, replace the _partial_ template from [Step 2][]
|
||||
</script>
|
||||
```
|
||||
|
||||
The delimiters above must match the delimiters in your site configuration.
|
||||
The delimiters above must match the delimiters in your project configuration.
|
||||
|
||||
## Chemistry
|
||||
|
||||
|
||||
@@ -20,14 +20,14 @@ There are three ways to define menu entries:
|
||||
|
||||
1. Automatically
|
||||
1. In front matter
|
||||
1. In site configuration
|
||||
1. In your project configuration
|
||||
|
||||
> [!note]
|
||||
> Although you can use these methods in combination when defining a menu, the menu will be easier to conceptualize and maintain if you use one method throughout the site.
|
||||
|
||||
## Define automatically
|
||||
|
||||
To automatically define a menu entry for each top-level [section](g) of your site, enable the section pages menu in your site configuration.
|
||||
To automatically define a menu entry for each top-level [section](g) of your site, enable the section pages menu in your project configuration.
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
sectionPagesMenu = "main"
|
||||
@@ -82,7 +82,7 @@ class = 'center'
|
||||
|
||||
Access the entry with `site.Menus.main` in your templates. See [menu templates] for details.
|
||||
|
||||
## Define in site configuration
|
||||
## Define in project configuration
|
||||
|
||||
See [configure menus](/configuration/menus/).
|
||||
|
||||
|
||||
@@ -253,8 +253,8 @@ See [lang.FormatPercent] for details.
|
||||
Localization of menu entries depends on how you define them:
|
||||
|
||||
- When you define menu entries [automatically] using the section pages menu, you must use translation tables to localize each entry.
|
||||
- When you define menu entries [in front matter], they are already localized based on the front matter itself. If the front matter values are insufficient, use translation tables to localize each entry.
|
||||
- When you define menu entries [in site configuration], you must create language-specific menu entries under each language key. If the names of the menu entries are insufficient, use translation tables to localize each entry.
|
||||
- When you define menu entries in [front matter], they are already localized based on the front matter itself. If the front matter values are insufficient, use translation tables to localize each entry.
|
||||
- When you define menu entries in your [project configuration], you must create language-specific menu entries under each language key. If the names of the menu entries are insufficient, use translation tables to localize each entry.
|
||||
|
||||
### Create language-specific menu entries
|
||||
|
||||
@@ -341,9 +341,9 @@ It queries the translation table for the current language using the menu entry's
|
||||
The `identifier` depends on how you define menu entries:
|
||||
|
||||
- If you define the menu entry [automatically] using the section pages menu, the `identifier` is the page's `.Section`.
|
||||
- If you define the menu entry [in site configuration] or [in front matter], set the `identifier` property to the desired value.
|
||||
- If you define the menu entry in your [project configuration] or in [front matter], set the `identifier` property to the desired value.
|
||||
|
||||
For example, if you define menu entries in site configuration:
|
||||
For example, if you define menu entries in project configuration:
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
[[menus.main]]
|
||||
@@ -379,7 +379,7 @@ For merging of content from other languages (i.e. missing content translations),
|
||||
To track down missing translation strings, run Hugo with the `--printI18nWarnings` flag:
|
||||
|
||||
```sh
|
||||
hugo --printI18nWarnings | grep i18n
|
||||
hugo build --printI18nWarnings | grep i18n
|
||||
i18n|MISSING_TRANSLATION|en|wordCount
|
||||
```
|
||||
|
||||
@@ -418,12 +418,12 @@ hugo new content content/de/post/test.md
|
||||
[config]: /configuration/
|
||||
[configuration directory]: /configuration/introduction/#configuration-directory
|
||||
[example menu template]: /templates/menu/#example
|
||||
[front matter]: /content-management/menus/#define-in-front-matter
|
||||
[i18func]: /functions/lang/translate/
|
||||
[in front matter]: /content-management/menus/#define-in-front-matter
|
||||
[in site configuration]: /content-management/menus/#define-in-site-configuration
|
||||
[lang.FormatAccounting]: /functions/lang/formataccounting/
|
||||
[lang.FormatCurrency]: /functions/lang/formatcurrency/
|
||||
[lang.FormatNumber]: /functions/lang/formatnumber/
|
||||
[lang.FormatNumberCustom]: /functions/lang/formatnumbercustom/
|
||||
[lang.FormatPercent]: /functions/lang/formatpercent/
|
||||
[lang.Merge]: /functions/lang/merge/
|
||||
[project configuration]: /content-management/menus/#define-in-project-configuration
|
||||
|
||||
@@ -61,7 +61,7 @@ Without any additional configuration, the following will automatically work:
|
||||
|
||||
## Path breakdown in Hugo
|
||||
|
||||
The following demonstrates the relationships between your content organization and the output URL structure for your Hugo website when it renders. These examples assume you are [using pretty URLs][pretty], which is the default behavior for Hugo. The examples also assume a key-value of `baseURL = "https://example.org/"` in your [site's configuration file][config].
|
||||
The following demonstrates the relationships between your content organization and the output URL structure for your Hugo website when it renders. These examples assume you are [using pretty URLs][pretty], which is the default behavior for Hugo. The examples also assume a key-value of `baseURL = "https://example.org/"` in your [project configuration][config].
|
||||
|
||||
### Index pages: `_index.md`
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ By default, with a multilingual single-host site, Hugo does not duplicate shared
|
||||
> [!note]
|
||||
> This behavior is limited to Markdown content. Shared page resources for other [content formats] are copied into each language bundle.
|
||||
|
||||
Consider this site configuration:
|
||||
Consider this project configuration:
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
defaultContentLanguage = 'de'
|
||||
@@ -278,7 +278,7 @@ This approach reduces build times, storage requirements, bandwidth consumption,
|
||||
>
|
||||
> You can also configure Hugo to `always` use the embedded link or image render hook, use it only as a `fallback`, or `never` use it. See [details](/configuration/markup/#renderhookslinkuseembedded).
|
||||
|
||||
Although duplicating shared page resources is inefficient, you can enable this feature in your site configuration if desired:
|
||||
Although duplicating shared page resources is inefficient, you can enable this feature in your project configuration if desired:
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
[markup.goldmark]
|
||||
|
||||
@@ -42,7 +42,7 @@ An inline shortcode is a _shortcode_ template defined within content.
|
||||
|
||||
Hugo's security model is based on the premise that template and configuration authors are trusted, but content authors are not. This model enables generation of HTML output safe against code injection.
|
||||
|
||||
To conform with this security model, creating _shortcode_ templates within content is disabled by default. If you trust your content authors, you can enable this functionality in your site's configuration:
|
||||
To conform with this security model, creating _shortcode_ templates within content is disabled by default. If you trust your content authors, you can enable this functionality in your project configuration:
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
[security]
|
||||
|
||||
@@ -84,7 +84,7 @@ This is the second paragraph.
|
||||
|
||||
## Automatic summary
|
||||
|
||||
If you do not define the summary manually or in front matter, Hugo automatically defines the summary based on the [`summaryLength`] in your site configuration.
|
||||
If you do not define the summary manually or in front matter, Hugo automatically defines the summary based on the [`summaryLength`] in your project configuration.
|
||||
|
||||
[`summaryLength`]: /configuration/all/#summarylength
|
||||
|
||||
|
||||
@@ -32,10 +32,10 @@ LANG
|
||||
: The language of the code to highlight. Choose from one of the [supported languages]. This value is case-insensitive.
|
||||
|
||||
OPTIONS
|
||||
: One or more space-separated or comma-separated key-value pairs wrapped in braces. Set default values for each option in your [site configuration]. The key names are case-insensitive.
|
||||
: One or more space-separated or comma-separated key-value pairs wrapped in braces. Set default values for each option in your [project configuration]. The key names are case-insensitive.
|
||||
|
||||
[supported languages]: #languages
|
||||
[site configuration]: /configuration/markup/#highlight
|
||||
[project configuration]: /configuration/markup/#highlight
|
||||
|
||||
For example, with this Markdown:
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: URL management
|
||||
description: Control the structure and appearance of URLs through front matter entries and settings in your site configuration.
|
||||
description: Control the structure and appearance of URLs through front matter entries and settings in your project configuration.
|
||||
categories: []
|
||||
keywords: []
|
||||
aliases: [/extras/permalinks/,/extras/aliases/,/extras/urls/,/doc/redirects/,/doc/alias/,/doc/aliases/]
|
||||
@@ -14,7 +14,7 @@ By default, when Hugo renders a page, the resulting URL matches the file path wi
|
||||
content/posts/post-1.md → https://example.org/posts/post-1/
|
||||
```
|
||||
|
||||
You can change the structure and appearance of URLs with front matter values and site configuration options.
|
||||
You can change the structure and appearance of URLs with front matter values and project configuration options.
|
||||
|
||||
## Front matter
|
||||
|
||||
@@ -121,7 +121,7 @@ Use any of these tokens:
|
||||
|
||||
{{% include "/_common/permalink-tokens.md" %}}
|
||||
|
||||
## Site configuration
|
||||
## Project configuration
|
||||
|
||||
### Permalinks
|
||||
|
||||
@@ -185,7 +185,7 @@ Aliases allow you to redirect old URLs to new URLs. This is essential for preven
|
||||
|
||||
### Defining aliases
|
||||
|
||||
To add redirects to a page, list the previous paths in the [`aliases`][aliases_field] field in your front matter. Hugo resolves these to [server-relative](g) paths during the build process, accounting for the [`baseURL`][] and [content dimension](g) prefixes such as language, role, or version.
|
||||
To add redirects to a page, list the previous paths in the [`aliases`][aliases_field] field in your front matter. Hugo resolves these to [server-relative](g) paths during the build process, accounting for the [`baseURL`][] and [content dimension](g) prefixes such as language, version, or role.
|
||||
|
||||
{{< code-toggle file=content/examples/example-1.en.md fm=true >}}
|
||||
title = 'Example 1'
|
||||
@@ -247,7 +247,7 @@ To implement this, you typically create a single template to generate the necess
|
||||
|
||||
See the [`Aliases`][aliases_method] method page for a complete example of how to iterate through pages to generate these rules.
|
||||
|
||||
If you implement server-side redirects, you should disable the generation of individual HTML files by setting [`disableAliases`][] to `true` in your site configuration. This setting only prevents the generation of the physical HTML files; the `Aliases` method on a `Page` object remains available for use in your configuration templates.
|
||||
If you implement server-side redirects, you should disable the generation of individual HTML files by setting [`disableAliases`][] to `true` in your project configuration. This setting only prevents the generation of the physical HTML files; the `Aliases` method on a `Page` object remains available for use in your configuration templates.
|
||||
|
||||
[`baseURL`]: /configuration/all/#baseurl
|
||||
[`disableAliases`]: /configuration/all/#disablealiases
|
||||
|
||||
@@ -143,7 +143,7 @@ CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@latest
|
||||
To build and install a specific release:
|
||||
|
||||
```sh
|
||||
CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@v0.155.3
|
||||
CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@v0.156.0
|
||||
```
|
||||
|
||||
To build and install at the latest commit on the master branch:
|
||||
|
||||
@@ -192,7 +192,7 @@ Field|Description|Required
|
||||
`params.minversion`|Applicable to the quick start page: the minimum Hugo version required|
|
||||
`params.permalink`|Reserved for use by the news content adapter|
|
||||
`params.reference (used in glossary term)`|Applicable to glossary entries: a URL for additional information|
|
||||
`params.searchable`|Whether to add the content of this page to the search index. The default value is cascaded down from the site configuration; `true` if the page kind is `page`, and `false` if the page kind is one of `home`, `section`, `taxonomy`, or `term`. Add this field to override the default value.|
|
||||
`params.searchable`|Whether to add the content of this page to the search index. The default value is cascaded down from the project configuration; `true` if the page kind is `page`, and `false` if the page kind is one of `home`, `section`, `taxonomy`, or `term`. Add this field to override the default value.|
|
||||
`params.show_publish_date`|Whether to show the `publishDate` when rendering the page|
|
||||
`weight`|The page weight|
|
||||
`aliases`|Previous URLs used to access this page|
|
||||
@@ -291,9 +291,9 @@ Use this syntax :
|
||||
```
|
||||
````
|
||||
|
||||
### Site configuration
|
||||
### Project configuration
|
||||
|
||||
Use the [code-toggle shortcode](#code-toggle) to include site configuration examples:
|
||||
Use the [code-toggle shortcode](#code-toggle) to include project configuration examples:
|
||||
|
||||
```text
|
||||
{{</* code-toggle file=hugo */>}}
|
||||
@@ -371,25 +371,25 @@ These shortcodes are commonly used throughout the documentation. Other shortcode
|
||||
|
||||
### code-toggle
|
||||
|
||||
Use the `code-toggle` shortcode to display examples of site configuration, front matter, or data files. This shortcode takes these arguments:
|
||||
Use the `code-toggle` shortcode to display examples of project configuration, front matter, or data files. This shortcode takes these arguments:
|
||||
|
||||
config
|
||||
: (`string`) The section of `site.Data.docs.config` to render.
|
||||
: (`string`) The section of `hugo.Data.docs.config` to render.
|
||||
|
||||
copy
|
||||
: (`bool`) Whether to display a copy-to-clipboard button. Default is `false`.
|
||||
|
||||
datakey:
|
||||
: (`string`) The section of `site.Data.docs` to render.
|
||||
: (`string`) The section of `hugo.Data.docs` to render.
|
||||
|
||||
file
|
||||
: (`string`) The file name to display above the rendered code. Omit the file extension for site configuration examples.
|
||||
: (`string`) The file name to display above the rendered code. Omit the file extension for project configuration examples.
|
||||
|
||||
fm
|
||||
: (`bool`) Whether to render the code as front matter. Default is `false`.
|
||||
|
||||
skipHeader
|
||||
: (`bool`) Whether to omit top-level key(s) when rendering a section of `site.Data.docs.config`.
|
||||
: (`bool`) Whether to omit top-level key(s) when rendering a section of `hugo.Data.docs.config`.
|
||||
|
||||
```text
|
||||
{{</* code-toggle file=hugo copy=true */>}}
|
||||
|
||||
@@ -11,7 +11,7 @@ params:
|
||||
aliases: [/functions/isset]
|
||||
---
|
||||
|
||||
For example, consider this site configuration:
|
||||
For example, consider this project configuration:
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
[params]
|
||||
|
||||
@@ -34,7 +34,7 @@ Hugo renders this to:
|
||||
<a href="https://example.org?a=1&b=2">Link</a>
|
||||
```
|
||||
|
||||
You can also pass in a map from your site configuration or front matter. For example:
|
||||
You can also pass in a map from your project configuration or front matter. For example:
|
||||
|
||||
{{< code-toggle file=content/example.md fm=true >}}
|
||||
title = 'Example'
|
||||
|
||||
@@ -17,7 +17,7 @@ The `ORDER` may be either `asc` (ascending) or `desc` (descending). The default
|
||||
|
||||
## Sort a slice
|
||||
|
||||
The examples below assume this site configuration:
|
||||
The examples below assume this project configuration:
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
[params]
|
||||
@@ -47,7 +47,7 @@ In the example above, `value` is the `KEY` representing the value of the slice e
|
||||
|
||||
## Sort a map
|
||||
|
||||
The examples below assume this site configuration:
|
||||
The examples below assume this project configuration:
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
[params.authors.a]
|
||||
|
||||
@@ -23,7 +23,7 @@ Hugo will test for equality if you do not provide an `OPERATOR` argument. For ex
|
||||
|
||||
```go-html-template
|
||||
{{ $pages := where .Site.RegularPages "Section" "books" }}
|
||||
{{ $books := where .Site.Data.books "genres" "suspense" }}
|
||||
{{ $books := where hugo.Data.books "genres" "suspense" }}
|
||||
```
|
||||
|
||||
## Arguments
|
||||
@@ -264,13 +264,13 @@ Useful for theme authors, avoid hardcoding section names by using the `where` fu
|
||||
{{ $pages := where .Site.RegularPages "Section" "in" .Site.MainSections }}
|
||||
```
|
||||
|
||||
With this construct, a theme author can instruct users to specify their main sections in the site configuration:
|
||||
With this construct, a theme author can instruct users to specify their main sections in their project configuration:
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
mainSections = ['blog','galleries']
|
||||
{{< /code-toggle >}}
|
||||
|
||||
If `mainSections` is not defined in the site configuration, the `MainSections` method returns a slice with one element---the top-level section with the most pages.
|
||||
If `mainSections` is not defined in your project configuration, the `MainSections` method returns a slice with one element---the top-level section with the most pages.
|
||||
|
||||
## Boolean/undefined comparison
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ To use Dart Sass with Hugo on a [CI/CD](g) platform, you typically must modify y
|
||||
There's one key exception where you can skip this step: you have committed your `resources` directory to your repository. This is only possible if:
|
||||
|
||||
- You have not changed Hugo's default asset cache location.
|
||||
- You have not set [`useResourceCacheWhen`][] to never in your sites configuration.
|
||||
- You have not set [`useResourceCacheWhen`][] to never in your project configuration.
|
||||
|
||||
By committing the `resources` directory, you're providing the pre-built CSS files directly to your CI/CD platform, so it doesn't need to run the Sass compilation itself.
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ Step 1
|
||||
: Install the Tailwind CSS CLI v4.0 or later:
|
||||
|
||||
```sh {copy=true}
|
||||
npm install --save-dev tailwindcss @tailwindcss/cli
|
||||
npm install --save-dev tailwindcss @tailwindcss/cli @tailwindcss/typography
|
||||
```
|
||||
|
||||
The Tailwind CSS CLI is also available as a [standalone executable]. You must install it outside of your project directory and ensure its path is included in your system's `PATH` environment variable.
|
||||
@@ -37,7 +37,7 @@ Step 1
|
||||
[standalone executable]: https://github.com/tailwindlabs/tailwindcss/releases/latest
|
||||
|
||||
Step 2
|
||||
: Add this to your site configuration:
|
||||
: Add this to your project configuration:
|
||||
|
||||
{{< code-toggle file=hugo copy=true >}}
|
||||
[build]
|
||||
@@ -64,6 +64,7 @@ Step 3
|
||||
|
||||
```css {file="assets/css/main.css" copy=true}
|
||||
@import "tailwindcss";
|
||||
@plugin "@tailwindcss/typography";
|
||||
@source "hugo_stats.json";
|
||||
```
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ params:
|
||||
---
|
||||
|
||||
```go-html-template
|
||||
<pre>{{ debug.Dump site.Data.books }}</pre>
|
||||
<pre>{{ debug.Dump hugo.Data.books }}</pre>
|
||||
```
|
||||
|
||||
```json
|
||||
|
||||
@@ -25,7 +25,7 @@ The timer starts when you instantiate it, and stops when you call its `Stop` met
|
||||
Use the `--logLevel info` command line flag when you build the site.
|
||||
|
||||
```sh
|
||||
hugo --logLevel info
|
||||
hugo build --logLevel info
|
||||
```
|
||||
|
||||
The results are displayed in the console at the end of the build. You can have as many timers as you want and if you don't stop them, they will be stopped at the end of build.
|
||||
|
||||
@@ -13,7 +13,7 @@ aliases: [/functions/erroridf]
|
||||
|
||||
{{% include "/_common/functions/fmt/format-string.md" %}}
|
||||
|
||||
The `erroridf` function evaluates the format string, then prints the result to the ERROR log and fails the build. Unlike the [`errorf`] function, you may suppress errors logged by the `erroridf` function by adding the message ID to the `ignoreLogs` array in your site configuration.
|
||||
The `erroridf` function evaluates the format string, then prints the result to the ERROR log and fails the build. Unlike the [`errorf`] function, you may suppress errors logged by the `erroridf` function by adding the message ID to the `ignoreLogs` array in your project configuration.
|
||||
|
||||
This template code:
|
||||
|
||||
@@ -25,7 +25,7 @@ Produces this console log:
|
||||
|
||||
```text
|
||||
ERROR You should consider fixing this.
|
||||
You can suppress this error by adding the following to your site configuration:
|
||||
You can suppress this error by adding the following to your project configuration:
|
||||
ignoreLogs = ['error-42']
|
||||
```
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user