Merge commit '5be51ac3db225d5df501ed1fa1499c41d97dbf65'

This commit is contained in:
Bjørn Erik Pedersen
2025-04-10 13:04:51 +02:00
987 changed files with 12379 additions and 14083 deletions
+1 -9
View File
@@ -1,16 +1,8 @@
---
title: Quick reference guides
linktitle: Quick reference
linkTitle: Quick reference
description: Use these quick reference guides for quick access to key information.
categories: []
keywords: []
menu:
docs:
identifier: quick-reference-in-this-section
parent: quick-reference
weight: 10
weight: 10
showSectionMenu: false
---
{{% param description %}}
+2 -8
View File
@@ -1,14 +1,8 @@
---
title: Emojis
description: Include emoji shortcodes in your Markdown or templates.
categories: [quick reference]
keywords: [emoji]
menu:
docs:
parent: quick-reference
weight: 20
weight: 20
toc: true
categories: []
keywords: []
---
## Attribution
+1 -7
View File
@@ -1,14 +1,8 @@
---
title: Functions
description: A quick reference guide to Hugo's functions, grouped by namespace. Aliases, if any, appear in parentheses to the right of the function name.
categories: [quick reference]
categories: []
keywords: []
menu:
docs:
parent: quick-reference
weight: 30
weight: 30
toc: true
---
{{% quick-reference section="functions" %}}
@@ -1,16 +1,8 @@
---
title: Glossary
description: Terms commonly used throughout the documentation.
categories: [quick-reference]
keywords: [glossary]
hide_in_this_section: true
menu:
docs:
parent: quick-reference
weight: 40
aliases: [/getting-started/glossary/]
weight: 40
layout: single
categories: []
keywords: []
build:
render: always
list: always
@@ -18,6 +10,10 @@ cascade:
build:
render: never
list: local
layout: single
params:
hide_in_this_section: true
aliases: [/getting-started/glossary/]
---
{{% glossary %}}
@@ -0,0 +1,7 @@
---
title: CI/CD
params:
reference: https://en.wikipedia.org/wiki/CI/CD
---
The term _CI/CD_ is an abbreviation for Continuous Integration and Continuous Delivery or Continuous Deployment depending on context.
@@ -2,4 +2,4 @@
title: CLI
---
_CLI_ is an abbreviation of Command Line Interface.
_CLI_ stands for command-line interface, a text-based method for interacting with computer programs or operating systems.
@@ -2,4 +2,9 @@
title: default sort order
---
The _default sort order_ is the default order in which Hugo sorts page collections: by [_weight_](g), then by date (descending), then by link title, and then by file path.
The _default sort order_ for [_page collections_](g), used when no other criteria are set, follows this priority:
1. [`weight`](/content-management/front-matter/#weight) (ascending)
1. [`date`](/content-management/front-matter/#date) (descending)
1. [`linkTitle`](/content-management/front-matter/#linktitle) falling back to [`title`](/content-management/front-matter/#title) (ascending)
1. [logical path](g) (ascending)
@@ -4,8 +4,6 @@ title: environment
Typically one of `development`, `staging`, or `production`, each _environment_ may exhibit different behavior depending on configuration and template logic. For example, in a production environment you might minify and fingerprint CSS, but that probably doesn't make sense in a development environment.
When running the built-in development server with the `hugo server` command, the environment is set to `development`. When building your site with the `hugo` command, the environment is set to `production`. To override the environment value, use the `--environment` command line flag or the `HUGO_ENVIRONMENT` environment variable.
When running the built-in development server with the `hugo server` command, the environment is set to `development`. When building your site with the `hugo` command, the environment is set to `production`. To override the environment value, use the `--environment` command line flag or the `HUGO_ENVIRONMENT` environment variable.
To determine the current environment within a template, use the [`hugo.Environment`] function.
[`hugo.Environment`]: /functions/hugo/environment/
To determine the current environment within a template, use the [`hugo.Environment`](/functions/hugo/environment/) function.
@@ -3,4 +3,4 @@ title: glob
reference: https://github.com/gobwas/glob?tab=readme-ov-file#example
---
A _glob_ is a pattern used to match filenames and paths. It's a shorthand for specifying a set of files, making it easier to work with multiple files at once.
A _glob_ is a pattern used to match file names and paths. It's a shorthand for specifying a set of files, making it easier to work with multiple files at once.
@@ -4,8 +4,8 @@ title: interval
An [_interval_](https://en.wikipedia.org/wiki/Interval_(mathematics)) is a range of numbers between two endpoints: closed, open, or half-open.
- A _closed interval_, denoted by brackets, includes its endpoints. For example, [0,&nbsp;1]&nbsp;is the interval where `0 <= x <= 1`.
- A _closed interval_, denoted by brackets, includes its endpoints. For example, [0,&nbsp;1]&nbsp;is the interval where `0 <= x <= 1`.
- An _open interval_, denoted by parentheses, excludes its endpoints. For example, (0,&nbsp;1)&nbsp;is the interval where `0 < x < 1`.
- An _open interval_, denoted by parentheses, excludes its endpoints. For example, (0,&nbsp;1)&nbsp;is the interval where `0 < x < 1`.
- A _half-open interval_ includes only one of its endpoints. For example, (0,&nbsp;1]&nbsp;is the _left-open_ interval where `0 < x <= 1`, while [0,&nbsp;1)&nbsp;is the _right-open_ interval where `0 <= x < 1`.
- A _half-open interval_ includes only one of its endpoints. For example, (0,&nbsp;1]&nbsp;is the _left-open_ interval where `0 < x <= 1`, while [0,&nbsp;1)&nbsp;is the _right-open_ interval where `0 <= x < 1`.
@@ -3,6 +3,4 @@ title: logical path
reference: /methods/page/path/#examples
---
{{< new-in 0.123.0 />}}
A _logical path_ is a page or page resource identifier derived from the file path, excluding its extension and language identifier. This value is neither a file path nor a URL. Starting with a file path relative to the `content` directory, Hugo determines the logical path by stripping the file extension and language identifier, converting to lower case, then replacing spaces with hyphens.
A _logical path_ is a page or page resource identifier derived from the file path, excluding its extension and language identifier. This value is neither a file path nor a URL. Starting with a file path relative to the `content` directory, Hugo determines the logical path by stripping the file extension and language identifier, converting to lower case, then replacing spaces with hyphens. Path segments are separated with a slash (`/`).
@@ -3,4 +3,4 @@ title: Markdown attribute
reference: /content-management/markdown-attributes/
---
A _Markdown attribute_ is a key-value pair attached to a Markdown element. These attributes are commonly used to add HTML attributes, like `class` and `id`, to the element when it's rendered into HTML. They provide a way to extend the basic Markdown syntax and add more semantic meaning or styling hooks to your content.
A _Markdown attribute_ is a key-value pair attached to a Markdown element. These attributes are commonly used to add HTML attributes, like `class` and `id`, to the element when it's rendered into HTML. They provide a way to extend the basic Markdown syntax and add more semantic meaning or styling hooks to your content.
@@ -0,0 +1,6 @@
---
title: media type
reference: /configuration/media-types/
---
A _media type_ (formerly known as a MIME type) is a two-part identifier for file formats and transmitted content. For example, the media type for JSON data is `application/json`.
@@ -2,4 +2,4 @@
title: method
---
Used within a [_template action_](g) and associated with an [_object_](g), a _method_ takes zero or more [_arguments_](g) and either returns a value or performs an action. For example, `.IsHome` is a method on the `.Page` object which returns `true` if the current page is the home page. See also [_function_](g).
Used within a [_template action_](g) and associated with an [_object_](g), a _method_ takes zero or more [_arguments_](g) and either returns a value or performs an action. For example, `IsHome` is a method on a `Page` object which returns `true` if the current page is the home page. See also [_function_](g).
@@ -2,7 +2,4 @@
title: ordered taxonomy
---
Created by invoking the [`Alphabetical`] or [`ByCount`] method on a [`Taxonomy`](g) object, which is a [_map_](g), an _ordered taxonomy_ is a [_slice_](g), where each element is an object that contains the [_term_](g) and a slice of its [weighted pages](g).
[`Alphabetical`]: /methods/taxonomy/alphabetical/
[`ByCount`]: /methods/taxonomy/bycount/
Created by invoking the [`Alphabetical`](/methods/taxonomy/alphabetical/) or [`ByCount`](/methods/taxonomy/bycount/) method on a [`Taxonomy`](g) object, which is a [_map_](g), an _ordered taxonomy_ is a [_slice_](g), where each element is an object that contains the [_term_](g) and a slice of its [_weighted pages_](g).
@@ -1,6 +1,6 @@
---
title: output format
reference: /templates/output-formats/
reference: /configuration/output-formats/
---
An _output format_ is a collection of settings that defines how Hugo renders a file when building a site. For example, `html`, `rss`, and `json` are built-in output formats. You can create multiple output formats and control their generation based on [page kind](g), or by enabling one or more output formats for specific pages.
An _output format_ is a collection of settings that defines how Hugo renders a file when building a site. For example, `html`, `json`, and `rss` are built-in output formats. You can create multiple output formats and control their generation based on [page kind](g), or by enabling one or more output formats for specific pages.
@@ -4,4 +4,4 @@ title: pipeline
Within a [_template action_](g), a _pipeline_ is a possibly chained sequence of values, [_function_](g) calls, or [_method_](g) calls. Functions and methods in the pipeline may take multiple [_arguments_](g).
A pipeline may be *chained* by separating a sequence of commands with pipeline characters (`|`). In a chained pipeline, the result of each command is passed as the last argument to the following command. The output of the final command in the pipeline is the value of the pipeline.
A pipeline may be chained by separating a sequence of commands with pipeline characters (`|`). In a chained pipeline, the result of each command is passed as the last argument to the following command. The output of the final command in the pipeline is the value of the pipeline.
@@ -0,0 +1,10 @@
---
title: primary output format
details: /configuration/outputs/
---
A _primary output format_ defines the default URL returned by the [`Permalink`] and [`RelPermalink`] methods for a given [page kind](g). It is specified as the first entry within the [outputs configuration] for that page kind.
[`Permalink`]: /methods/page/permalink/
[`RelPermalink`]: /methods/page/relpermalink/
[outputs configuration]: /configuration/outputs/
@@ -0,0 +1,8 @@
---
title: regular expression
reference:
---
A _regular expression_, also known as a _regex_, is a sequence of characters that defines a search pattern. Use the [RE2 syntax] when defining regular expressions in your templates or site configuration.
[RE2 syntax]: https://github.com/google/re2/wiki/syntax
@@ -2,7 +2,4 @@
title: resource type
---
A _resource type_ is the main type of a resource's [media type]. Content files such as Markdown, HTML, AsciiDoc, Pandoc, reStructuredText, and Emacs Org Mode have resource type `page`. Other resource types include `image`, `video`, etc. Retrieve the resource type using the [`ResourceType`] method on a `Resource` object.
[media type]: /methods/resource/mediatype/
[`ResourceType`]: /methods/resource/resourcetype/
A _resource type_ is the main type of a resource's [media type](/methods/resource/mediatype/). Content files such as Markdown, HTML, AsciiDoc, Pandoc, reStructuredText, and Emacs Org Mode have resource type `page`. Other resource types include `image`, `text`, `video`, and others. Retrieve the resource type using the [`ResourceType`](/methods/resource/resourcetype/) method on a `Resource` object.
@@ -4,4 +4,4 @@ title: resource
A _resource_ is any file consumed by the build process to augment or generate content, structure, behavior, or presentation. For example: images, videos, content snippets, CSS, Sass, JavaScript, and data.
Hugo supports three types of resources: [_global resources_](g), [_page resources_](g), and [_remote resources_](g).
Hugo supports three types of resources: [_global resources_](g), [_page resources_](g), and [_remote resources_](g).
@@ -2,7 +2,4 @@
title: scratch pad
---
Conceptually, a _scratch pad_ is a [_map_](g) with [_methods_](g) to set, get, update, and delete values. Attach the data structure to a `Page` or `Site` object using the [`Store`] method, or create a locally scoped scratch pad using the [`newScratch`] function.
[`Store`]: /methods/page/store/
[`newScratch`]: /functions/collections/newscratch/
Conceptually, a _scratch pad_ is a [_map_](g) with [_methods_](g) to set, get, update, and delete values. Attach the data structure to a `Page` or `Site` object using the [`Store`](/methods/page/store/) method, or create a locally scoped scratch pad using the [`newScratch`](/functions/collections/newscratch/) function.
@@ -3,4 +3,4 @@ title: shortcode
reference: /content-management/shortcodes
---
A _shortcode_ is a [_template_](g) invoked within markup, accepting any number of [_arguments_](g). They can be used with any [content format](g) to insert elements such as videos, images, and social media embeds into your content.
A _shortcode_ is a [_template_](g) invoked within markup, accepting any number of [_arguments_](g). They can be used with any [_content format_](g) to insert elements such as videos, images, and social media embeds into your content.
@@ -3,4 +3,4 @@ title: template action
reference: https://pkg.go.dev/text/template#hdr-Actions
---
A data evaluation or control structure within a [_template_](g), delimited by "{{"&nbsp;and&nbsp;"}}".
A data evaluation or control structure within a [_template_](g), delimited by `{{`&nbsp;and&nbsp;`}}`.
+1 -7
View File
@@ -1,14 +1,8 @@
---
title: Methods
description: A quick reference guide to Hugo's methods, grouped by object.
categories: [quick reference]
categories: []
keywords: []
menu:
docs:
parent: quick-reference
weight: 50
weight: 50
toc: true
---
{{% quick-reference section="methods" %}}
@@ -1,56 +1,38 @@
---
title: Page collections
description: A quick reference guide to Hugo's page collections.
categories: [quick reference]
categories: []
keywords: []
menu:
docs:
parent: quick-reference
weight: 60
weight: 60
toc: true
---
## Page
assets/
Use these `Page` methods when rendering lists on [section pages](g), [taxonomy pages](g), [term pages](g), and the home page.
{{< list-pages-in-section path=/methods/page filter=methods_page_page_collections filterType=include omitElementIDs=true titlePrefix=PAGE. >}}
{{% list-pages-in-section path=/methods/page filter=methods_page_page_collections filterType=include titlePrefix=PAGE. %}}
## Site
Use these `Site` methods when rendering lists on any page.
{{< list-pages-in-section path=/methods/site filter=methods_site_page_collections filterType=include omitElementIDs=true titlePrefix=SITE. >}}
{{% list-pages-in-section path=/methods/site filter=methods_site_page_collections filterType=include titlePrefix=SITE. %}}
## Filter
Use the [`where`] function to filter page collections.
[`where`]: /functions/collections/where/
## Sort
By default, Hugo sorts page collections by:
{{% glossary-term "default sort order" %}}
1. [Weight]
1. [Date] in descending order
1. [LinkTitle] falling back to [Title]
1. [Filename] if the page is backed by a file
Use these methods to sort page collections by different criteria.
[Date]: /methods/page/date/
[Weight]: /methods/page/weight/
[LinkTitle]: /methods/page/linktitle/
[Title]: /methods/page/title/
[Filename]: /methods/page/file/#filename
Use these methods to sort page collections.
{{< list-pages-in-section path=/methods/pages filter=methods_pages_sort filterType=include titlePrefix=. omitElementIDs=true titlePrefix=PAGES. >}}
{{% list-pages-in-section path=/methods/pages filter=methods_pages_sort filterType=include titlePrefix=. titlePrefix=PAGES. %}}
## Group
Use these methods to group page collections.
{{< list-pages-in-section path=/methods/pages filter=methods_pages_group filterType=include titlePrefix=. omitElementIDs=true titlePrefix=PAGES. >}}
{{% list-pages-in-section path=/methods/pages filter=methods_pages_group filterType=include titlePrefix=. titlePrefix=PAGES. %}}
[`where`]: /functions/collections/where/
@@ -0,0 +1,35 @@
---
title: Syntax highlighting styles
description: Highlight code examples using one of these styles.
categories: []
keywords: [highlight]
---
## Overview
Hugo provides several methods to add syntax highlighting to code examples:
- Use the [`transform.Highlight`] function within your templates
- Use the [`highlight`] shortcode with any [content format](g)
- Use fenced code blocks with the Markdown content format
Regardless of method, use any of the syntax highlighting styles below.
Set the default syntax highlighting style in your site configuration:
{{< code-toggle file=hugo >}}
[markup.highlight]
style = 'monokai'
{{< /code-toggle >}}
See [configure Markup](/configuration/markup/#highlight).
[`transform.Highlight`]: /functions/transform/highlight/
[`highlight`]: /shortcodes/highlight/
[fenced code blocks]: /content-management/syntax-highlighting/#fenced-code-blocks
## Styles
This gallery demonstrates the application of each syntax highlighting style with code examples written in different programming languages.
{{% syntax-highlighting-styles %}}