diff --git a/.cspell.json b/.cspell.json index 8d51085ab..264d0f01a 100644 --- a/.cspell.json +++ b/.cspell.json @@ -161,7 +161,7 @@ "# ----------------------------------------------------------------------", "achristie", "ccpa", - "crpa", + "cpra", "ddmaurier", "dring", "fleqn", @@ -171,6 +171,8 @@ "jsmith", "leqno", "milli", + "monokai", + "mysanityprojectid", "rgba", "rsmith", "tdewolff", diff --git a/.prettierignore b/.prettierignore index 39d080729..630782282 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,11 +1,12 @@ # Ignore all SVG icons. **/icons.html + # These are whitespace sensitive. layouts/_default/_markup/render-code* layouts/_default/_markup/render-table* - -# Odd template syntax. -layouts/_default/_markup/render-heading* +layouts/shortcodes/glossary-term.html +layouts/shortcodes/glossary.html +layouts/shortcodes/highlighting-styles.html # No root node. layouts/partials/layouts/head/head.html diff --git a/LICENSE.md b/LICENSE.md index 979711275..d4facbf8a 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,3 +1,3 @@ See [content/LICENSE.md](content/LICENSE.md) for the license of the content of this repository. -The theme (layouts, CSS, JavaScript etc.) of this repository has no open source license. It is custom made for the Hugo sites and is not meant for reuse. \ No newline at end of file +The theme (layouts, CSS, JavaScript etc.) of this repository has no open source license. It is custom made for the Hugo sites and is not meant for reuse. diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 000000000..58a60edc4 --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,6 @@ +--- +title: {{ replace .File.ContentBaseName "-" " " | strings.FirstUpper }} +description: +categories: [] +keywords: [] +--- diff --git a/archetypes/functions.md b/archetypes/functions.md index 44a2a5635..85859dc04 100644 --- a/archetypes/functions.md +++ b/archetypes/functions.md @@ -3,9 +3,10 @@ title: {{ replace .File.ContentBaseName "-" " " | title }} description: categories: [] keywords: [] -action: - aliases: [] - related: [] - returnType: - signatures: [] +params: + functions_and_methods: + aliases: [] + related: [] + returnType: + signatures: [] --- diff --git a/archetypes/glossary.md b/archetypes/glossary.md index 4fa4669ec..1eeb4ef4b 100644 --- a/archetypes/glossary.md +++ b/archetypes/glossary.md @@ -1,6 +1,7 @@ --- title: {{ replace .File.ContentBaseName "-" " " }} -reference: +params: + reference: --- diff --git a/content/en/_common/content-format-table.md b/content/en/_common/content-format-table.md new file mode 100644 index 000000000..c0a66a146 --- /dev/null +++ b/content/en/_common/content-format-table.md @@ -0,0 +1,13 @@ +--- +_comment: Do not remove front matter. +--- + +Content format|Media type|Identifier|File extensions +:--|:--|:--|:-- +Markdown|`text/markdown`|`markdown`|`markdown`,`md`, `mdown` +HTML|`text/html`|`html`|`htm`, `html` +Emacs Org Mode|`text/org`|`org`|`org` +AsciiDoc|`text/asciidoc`|`asciidoc`|`ad`, `adoc`, `asciidoc` +Pandoc|`text/pandoc`|`pandoc`|`pandoc`, `pdc` +reStructuredText|`text/rst`|`rst`|`rst` + diff --git a/content/en/templates/_common/filter-sort-group.md b/content/en/_common/filter-sort-group.md similarity index 100% rename from content/en/templates/_common/filter-sort-group.md rename to content/en/_common/filter-sort-group.md diff --git a/content/en/functions/fmt/_common/fmt-layout.md b/content/en/_common/functions/fmt/format-string.md similarity index 100% rename from content/en/functions/fmt/_common/fmt-layout.md rename to content/en/_common/functions/fmt/format-string.md diff --git a/content/en/functions/_common/go-html-template-package.md b/content/en/_common/functions/go-html-template-package.md similarity index 100% rename from content/en/functions/_common/go-html-template-package.md rename to content/en/_common/functions/go-html-template-package.md diff --git a/content/en/functions/go-template/_common/text-template.md b/content/en/_common/functions/go-template/text-template.md similarity index 100% rename from content/en/functions/go-template/_common/text-template.md rename to content/en/_common/functions/go-template/text-template.md diff --git a/content/en/functions/images/_common/apply-image-filter.md b/content/en/_common/functions/images/apply-image-filter.md similarity index 100% rename from content/en/functions/images/_common/apply-image-filter.md rename to content/en/_common/functions/images/apply-image-filter.md diff --git a/content/en/functions/js/_common/options.md b/content/en/_common/functions/js/options.md similarity index 91% rename from content/en/functions/js/_common/options.md rename to content/en/_common/functions/js/options.md index 12037c1ab..9dabb9426 100644 --- a/content/en/functions/js/_common/options.md +++ b/content/en/_common/functions/js/options.md @@ -8,16 +8,16 @@ params ```go-html-template {{ $js := resources.Get "js/main.js" | js.Build (dict "params" (dict "api" "https://example.org/api")) }} ``` -: And then in your JS file: + And then in your JS file: ```js import * as params from '@params'; ``` -: Note that this is meant for small data sets, e.g. configuration settings. For larger data, please put/mount the files into `assets` and import them directly. + Note that this is meant for small data sets, e.g. configuration settings. For larger data, please put/mount the files into `assets` and import them directly. minify -: (`bool`) Let `js.Build` handle the minification. +: (`bool`) Whether to let `js.Build` handle the minification. loaders : {{< new-in 0.140.0 />}} @@ -34,7 +34,7 @@ shims {{ $js = $js | js.Build dict "shims" $shims }} ``` -: The _shim_ files may look like these: + The _shim_ files may look like these: ```js // js/shims/react.js @@ -46,7 +46,7 @@ shims module.exports = window.ReactDOM; ``` -: With the above, these imports should work in both scenarios: + With the above, these imports should work in both scenarios: ```js import * as React from 'react'; @@ -90,13 +90,13 @@ JSXImportSource : {{< new-in 0.124.0 />}} : (`string`) Which library to use to automatically import its JSX helper functions from. This only works if `JSX` is set to `automatic`. The specified library needs to be installed through npm and expose certain exports. See https://esbuild.github.io/api/#jsx-import-source. -: The combination of `JSX` and `JSXImportSource` is helpful if you want to use a non-React JSX library like Preact, e.g.: + The combination of `JSX` and `JSXImportSource` is helpful if you want to use a non-React JSX library like Preact, e.g.: ```go-html-template {{ $js := resources.Get "js/main.jsx" | js.Build (dict "JSX" "automatic" "JSXImportSource" "preact") }} ``` -: With the above, you can use Preact components and JSX without having to manually import `h` and `Fragment` every time: + With the above, you can use Preact components and JSX without having to manually import `h` and `Fragment` every time: ```jsx import { render } from 'preact'; diff --git a/content/en/functions/_common/locales.md b/content/en/_common/functions/locales.md similarity index 99% rename from content/en/functions/_common/locales.md rename to content/en/_common/functions/locales.md index abcfb41c2..f27cfd893 100644 --- a/content/en/functions/_common/locales.md +++ b/content/en/_common/functions/locales.md @@ -3,7 +3,6 @@ _comment: Do not remove front matter. --- {{< note >}} - Localization of dates, currencies, numbers, and percentages is performed by the [gohugoio/locales] package. The language tag of the current site must match one of the listed locales. [gohugoio/locales]: https://github.com/gohugoio/locales diff --git a/content/en/functions/resources/_common/postcss-windows-warning.md b/content/en/_common/functions/postcss-windows-warning.md similarity index 100% rename from content/en/functions/resources/_common/postcss-windows-warning.md rename to content/en/_common/functions/postcss-windows-warning.md diff --git a/content/en/functions/_common/regular-expressions.md b/content/en/_common/functions/regular-expressions.md similarity index 100% rename from content/en/functions/_common/regular-expressions.md rename to content/en/_common/functions/regular-expressions.md diff --git a/content/en/functions/go-template/_common/truthy-falsy.md b/content/en/_common/functions/truthy-falsy.md similarity index 100% rename from content/en/functions/go-template/_common/truthy-falsy.md rename to content/en/_common/functions/truthy-falsy.md diff --git a/content/en/functions/urls/_common/anchorize-vs-urlize.md b/content/en/_common/functions/urls/anchorize-vs-urlize.md similarity index 92% rename from content/en/functions/urls/_common/anchorize-vs-urlize.md rename to content/en/_common/functions/urls/anchorize-vs-urlize.md index 710a3c592..e00c181b8 100644 --- a/content/en/functions/urls/_common/anchorize-vs-urlize.md +++ b/content/en/_common/functions/urls/anchorize-vs-urlize.md @@ -2,7 +2,7 @@ _comment: Do not remove front matter. --- -The [`anchorize`] and [`urlize`] functions are similar: +The [`anchorize`] and [`urlize`] functions are similar: [`anchorize`]: /functions/urls/anchorize/ [`urlize`]: /functions/urls/urlize/ diff --git a/content/en/functions/_common/glob-patterns.md b/content/en/_common/glob-patterns.md similarity index 100% rename from content/en/functions/_common/glob-patterns.md rename to content/en/_common/glob-patterns.md diff --git a/content/en/installation/_common/01-editions.md b/content/en/_common/installation/01-editions.md similarity index 94% rename from content/en/installation/_common/01-editions.md rename to content/en/_common/installation/01-editions.md index 11e7e9080..634002822 100644 --- a/content/en/installation/_common/01-editions.md +++ b/content/en/_common/installation/01-editions.md @@ -13,4 +13,4 @@ Deploy your site directly to a Google Cloud Storage bucket, an AWS S3 bucket, or [dart sass]: /functions/css/sass/#dart-sass [processing images]: /content-management/image-processing/ [transpile sass to css]: /functions/css/sass/ -[details]: /hosting-and-deployment/hugo-deploy/ +[details]: /host-and-deploy/deploy-with-hugo-deploy/ diff --git a/content/en/installation/_common/02-prerequisites.md b/content/en/_common/installation/02-prerequisites.md similarity index 100% rename from content/en/installation/_common/02-prerequisites.md rename to content/en/_common/installation/02-prerequisites.md diff --git a/content/en/installation/_common/03-prebuilt-binaries.md b/content/en/_common/installation/03-prebuilt-binaries.md similarity index 100% rename from content/en/installation/_common/03-prebuilt-binaries.md rename to content/en/_common/installation/03-prebuilt-binaries.md diff --git a/content/en/installation/_common/04-build-from-source.md b/content/en/_common/installation/04-build-from-source.md similarity index 100% rename from content/en/installation/_common/04-build-from-source.md rename to content/en/_common/installation/04-build-from-source.md diff --git a/content/en/installation/_common/homebrew.md b/content/en/_common/installation/homebrew.md similarity index 100% rename from content/en/installation/_common/homebrew.md rename to content/en/_common/installation/homebrew.md diff --git a/content/en/methods/menu-entry/_common/pre-post.md b/content/en/_common/menu-entries/pre-and-post.md similarity index 100% rename from content/en/methods/menu-entry/_common/pre-post.md rename to content/en/_common/menu-entries/pre-and-post.md diff --git a/content/en/_common/menu-entry-properties.md b/content/en/_common/menu-entry-properties.md new file mode 100644 index 000000000..daeadd79d --- /dev/null +++ b/content/en/_common/menu-entry-properties.md @@ -0,0 +1,31 @@ +--- +_comment: Do not remove front matter. +--- + + + +identifier +: (`string`) Required when two or more menu entries have the same `name`, or when localizing the `name` using translation tables. Must start with a letter, followed by letters, digits, or underscores. + +name +: (`string`) The text to display when rendering the menu entry. + +params +: (`map`) User-defined properties for the menu entry. + +parent +: (`string`) The `identifier` of the parent menu entry. If `identifier` is not defined, use `name`. Required for child entries in a nested menu. + +post +: (`string`) The HTML to append when rendering the menu entry. + +pre +: (`string`) The HTML to prepend when rendering the menu entry. + +title +: (`string`) The HTML `title` attribute of the rendered menu entry. + +weight +: (`int`) A non-zero integer indicating the entry's position relative the root of the menu, or to its parent for a child entry. Lighter entries float to the top, while heavier entries sink to the bottom. diff --git a/content/en/methods/page/_common/next-and-prev.md b/content/en/_common/methods/page/next-and-prev.md similarity index 96% rename from content/en/methods/page/_common/next-and-prev.md rename to content/en/_common/methods/page/next-and-prev.md index 0a3022265..babc88ff4 100644 --- a/content/en/methods/page/_common/next-and-prev.md +++ b/content/en/_common/methods/page/next-and-prev.md @@ -55,6 +55,6 @@ When you visit page-2: 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. -[site configuration]: /getting-started/configuration/#configure-page +[site configuration]: /configuration/page/ [`Next`]: /methods/pages/prev [`Prev`]: /methods/pages/prev diff --git a/content/en/methods/page/_common/nextinsection-and-previnsection.md b/content/en/_common/methods/page/nextinsection-and-previnsection.md similarity index 96% rename from content/en/methods/page/_common/nextinsection-and-previnsection.md rename to content/en/_common/methods/page/nextinsection-and-previnsection.md index 1d1f5438a..3d87a2d7a 100644 --- a/content/en/methods/page/_common/nextinsection-and-previnsection.md +++ b/content/en/_common/methods/page/nextinsection-and-previnsection.md @@ -55,7 +55,7 @@ When you visit page-2: 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. -[site configuration]: /getting-started/configuration/#configure-page +[site configuration]: /configuration/page/ [`Next`]: /methods/pages/prev [`Prev`]: /methods/pages/prev diff --git a/content/en/_common/methods/page/output-format-methods.md b/content/en/_common/methods/page/output-format-methods.md new file mode 100644 index 000000000..1e914db03 --- /dev/null +++ b/content/en/_common/methods/page/output-format-methods.md @@ -0,0 +1,35 @@ +--- +_comment: Do not remove front matter. +--- + +### Get IDENTIFIER + +(`any`) Returns the `OutputFormat` object with the given identifier. + +### MediaType + +(`media.Type`) Returns the media type of the output format. + +### MediaType.MainType + +(`string`) Returns the main type of the output format's media type. + +### MediaType.SubType + +(`string`) Returns the subtype of the current format's media type. + +### Name + +(`string`) Returns the output identifier of the output format. + +### Permalink + +(`string`) Returns the permalink of the page generated by the current output format. + +### Rel + +(`string`) Returns the `rel` value of the output format, either the default or as defined in the site configuration. + +### RelPermalink + +(`string`) Returns the relative permalink of the page generated by the current output format. diff --git a/content/en/methods/pages/_common/group-sort-order.md b/content/en/_common/methods/pages/group-sort-order.md similarity index 100% rename from content/en/methods/pages/_common/group-sort-order.md rename to content/en/_common/methods/pages/group-sort-order.md diff --git a/content/en/methods/pages/_common/next-and-prev.md b/content/en/_common/methods/pages/next-and-prev.md similarity index 98% rename from content/en/methods/pages/_common/next-and-prev.md rename to content/en/_common/methods/pages/next-and-prev.md index 540783992..621d6b079 100644 --- a/content/en/methods/pages/_common/next-and-prev.md +++ b/content/en/_common/methods/pages/next-and-prev.md @@ -33,7 +33,7 @@ content/ And these templates: {{< code file=layouts/_default/list.html >}} -{{ range .Pages.ByWeight}} +{{ range .Pages.ByWeight }}
Related content:
+Related content:
+` (inline HTML element) tag. Valid values are `true` or `false`. The `code` tag will get a class with name `code-inline`.
+For example, with this Markdown:
-### Example: highlight shortcode
+{{< code file=content/example.md lang=text >}}
+```go {linenos=inline hl_lines=[3,"6-8"] style=emacs}
+package main
-```go-html-template
-{{* highlight go "linenos=table,hl_lines=8 15-17,linenostart=199" */>}}
-// ... code
-{{* / highlight */>}}
-```
+import "fmt"
-Gives this:
-
-{{< highlight go "linenos=table,hl_lines=8 15-17,linenostart=199" >}}
-// GetTitleFunc returns a func that can be used to transform a string to
-// title case.
-//
-// The supported styles are
-//
-// - "Go" (strings.Title)
-// - "AP" (see https://www.apstylebook.com/)
-// - "Chicago" (see https://www.chicagomanualofstyle.org/home.html)
-//
-// If an unknown or empty style is provided, AP style is what you get.
-func GetTitleFunc(style string) func(s string) string {
- switch strings.ToLower(style) {
- case "go":
- return strings.Title
- case "chicago":
- return transform.NewTitleConverter(transform.ChicagoStyle)
- default:
- return transform.NewTitleConverter(transform.APStyle)
- }
+func main() {
+ for i := 0; i < 3; i++ {
+ fmt.Println("Value of i:", i)
+ }
}
-{{< / highlight >}}
-
-## Highlight Hugo/Go template code
-
-For highlighting Hugo/Go template code on your page, add `/*` after the opening double curly braces and `*/` before closing curly braces.
-
-``` go
-{{*/* myshortcode */*/>}}
```
+{{< /code >}}
-Gives this:
+Hugo renders this:
-``` go
-{{* myshortcode */>}}
-```
+```go {linenos=inline, hl_lines=[3, "6-8"], style=emacs}
+package main
-## Highlight template function
+import "fmt"
-See [Highlight](/functions/transform/highlight/).
-
-## Highlighting in code fences
-
-Highlighting in code fences is enabled by default.
-
-````txt
-```go {linenos=table,hl_lines=[8,"15-17"],linenostart=199}
-// ... code
-```
-````
-
-Gives this:
-
-```go {linenos=table,hl_lines=[8,"15-17"],linenostart=199}
-// GetTitleFunc returns a func that can be used to transform a string to
-// title case.
-//
-// The supported styles are
-//
-// - "Go" (strings.Title)
-// - "AP" (see https://www.apstylebook.com/)
-// - "Chicago" (see https://www.chicagomanualofstyle.org/home.html)
-//
-// If an unknown or empty style is provided, AP style is what you get.
-func GetTitleFunc(style string) func(s string) string {
- switch strings.ToLower(style) {
- case "go":
- return strings.Title
- case "chicago":
- return transform.NewTitleConverter(transform.ChicagoStyle)
- default:
- return transform.NewTitleConverter(transform.APStyle)
- }
+func main() {
+ for i := 0; i < 3; i++ {
+ fmt.Println("Value of i:", i)
+ }
}
```
-The options are the same as in the [highlighting shortcode](/content-management/syntax-highlighting/#highlight-shortcode), including `linenos=false`, but note the slightly different Markdown attribute syntax.
+## Options
-## List of Chroma highlighting languages
+{{% include "_common/syntax-highlighting-options.md" %}}
-The full list of Chroma lexers and their aliases (which is the identifier used in the `highlight` template func or when doing highlighting in code fences):
+## Escaping
+
+When documenting shortcode usage, escape the tag delimiters:
+
+{{< code file=content/example.md lang=text >}}
+```text {linenos=inline}
+{{*/* shortcode-1 */*/>}}
+
+{{%/*/* shortcode-2 */*/%}}
+```
+{{< /code >}}
+
+Hugo renders this to:
+
+```text {linenos=inline}
+{{* shortcode-1 */>}}
+
+{{%/* shortcode-2 */%}}
+```
+
+## Languages
+
+These are the supported languages. Use one of the identifiers, not the language name, when specifying a language for:
+
+- The [`transform.Highlight`] function
+- The [`highlight`] shortcode
+- Fenced code blocks
{{< chroma-lexers >}}
diff --git a/content/en/content-management/taxonomies.md b/content/en/content-management/taxonomies.md
index ae80fc8a5..e8ba04c28 100644
--- a/content/en/content-management/taxonomies.md
+++ b/content/en/content-management/taxonomies.md
@@ -1,14 +1,8 @@
---
title: Taxonomies
description: Hugo includes support for user-defined taxonomies.
-categories: [content management]
-keywords: [taxonomies,metadata,front matter,terms]
-menu:
- docs:
- parent: content-management
- weight: 150
-weight: 150
-toc: true
+categories: []
+keywords: []
aliases: [/taxonomies/overview/,/taxonomies/usage/,/indexes/overview/,/doc/indexes/,/extras/indexes]
---
@@ -19,24 +13,24 @@ Hugo includes support for user-defined groupings of content called **taxonomies*
### Definitions
Taxonomy
-: a categorization that can be used to classify content
+: A categorization that can be used to classify content
Term
-: a key within the taxonomy
+: A key within the taxonomy
Value
-: a piece of content assigned to a term
+: A piece of content assigned to a term
## Example taxonomy: movie website
Let's assume you are making a website about movies. You may want to include the following taxonomies:
-* Actors
-* Directors
-* Studios
-* Genre
-* Year
-* Awards
+- Actors
+- Directors
+- Studios
+- Genre
+- Year
+- Awards
Then, in each of the movies, you would specify terms for each of these taxonomies (i.e., in the [front matter] of each of your movie content files). From these terms, Hugo would automatically create pages for each Actor, Director, Studio, Genre, Year, and Award, with each listing all of the Movies that matched that specific Actor, Director, Studio, Genre, Year, and Award.
@@ -75,60 +69,16 @@ Moonrise Kingdom <- Value
...
```
-## Default taxonomies
-
-Hugo natively supports taxonomies.
-
-Without adding a single line to your [site configuration] file, Hugo will automatically create taxonomies for `tags` and `categories`. That would be the same as manually [configuring your taxonomies](#configure-taxonomies) as below:
-
-{{< code-toggle config=taxonomies />}}
-
-If you do not want Hugo to create any taxonomies, set `disableKinds` in your [site configuration] to the following:
-
-{{< code-toggle file=hugo >}}
-disableKinds = ["taxonomy","term"]
-{{ code-toggle >}}
-
-{{% include "content-management/_common/page-kinds.md" %}}
-
### Default destinations
When taxonomies are used---and [taxonomy templates] are provided---Hugo will automatically create both a page listing all the taxonomy's terms and individual pages with lists of content associated with each term. For example, a `categories` taxonomy declared in your configuration and used in your content front matter will create the following pages:
-* A single page at `example.com/categories/` that lists all the terms within the taxonomy
-* [Individual taxonomy list pages][taxonomy templates] (e.g., `/categories/development/`) for each of the terms that shows a listing of all pages marked as part of that taxonomy within any content file's [front matter]
+- A single page at `example.com/categories/` that lists all the terms within the taxonomy
+- [Individual taxonomy list pages][taxonomy templates] (e.g., `/categories/development/`) for each of the terms that shows a listing of all pages marked as part of that taxonomy within any content file's [front matter]
-## Configure taxonomies
+## Configuration
-Custom taxonomies other than the [defaults](#default-taxonomies) must be defined in your [site configuration] before they can be used throughout the site. You need to provide both the plural and singular labels for each taxonomy. For example, `singular key = "plural value"` for TOML and `singular key: "plural value"` for YAML.
-
-### Example: adding a custom taxonomy named "series"
-
-{{< note >}}
-While adding custom taxonomies, you need to put in the default taxonomies too, _if you want to keep them_.
-{{< /note >}}
-
-{{< code-toggle file=hugo >}}
-[taxonomies]
- tag = "tags"
- category = "categories"
- series = "series"
-{{ code-toggle >}}
-
-### Example: removing default taxonomies
-
-If you want to have just the default `tags` taxonomy, and remove the `categories` taxonomy for your site, you can do so by modifying the `taxonomies` value in your [site configuration].
-
-{{< code-toggle file=hugo >}}
-[taxonomies]
- tag = "tags"
-{{ code-toggle >}}
-
-If you want to disable all taxonomies altogether, see the use of `disableKinds` in [Hugo Taxonomy Defaults](#default-taxonomies).
-
-{{< note >}}
-You can add content and front matter to your taxonomy list and taxonomy terms pages. See [Content Organization](/content-management/organization/) for more information on how to add an `_index.md` for this purpose.
-{{< /note >}}
+See [configure taxonomies](/configuration/taxonomies/).
## Assign terms to content
@@ -148,7 +98,7 @@ The following show a piece of content that has a weight of 22, which can be used
### Example: taxonomic `weight`
-{{< code-toggle >}}
+{{< code-toggle file=hugo >}}
title = "foo"
tags = [ "a", "b", "c" ]
tags_weight = 22
@@ -172,4 +122,4 @@ wikipedia: "https://en.wikipedia.org/wiki/Bruce_Willis"
[documentation on archetypes]: /content-management/archetypes/
[front matter]: /content-management/front-matter/
[taxonomy templates]: /templates/types/#taxonomy
-[site configuration]: /getting-started/configuration/
+[site configuration]: /configuration/
diff --git a/content/en/content-management/types.md b/content/en/content-management/types.md
index 9b44645e9..08e9adda2 100644
--- a/content/en/content-management/types.md
+++ b/content/en/content-management/types.md
@@ -1,14 +1,8 @@
---
title: Content types
description: Hugo is built around content organized in sections.
-categories: [content management]
-keywords: [lists,sections,content types,types,organization]
-menu:
- docs:
- parent: content-management
- weight: 130
-weight: 130
-toc: true
+categories: []
+keywords: []
aliases: [/content/types]
---
diff --git a/content/en/content-management/urls.md b/content/en/content-management/urls.md
index 76ef5e010..f399bd6cb 100644
--- a/content/en/content-management/urls.md
+++ b/content/en/content-management/urls.md
@@ -1,14 +1,8 @@
---
title: URL management
description: Control the structure and appearance of URLs through front matter entries and settings in your site configuration.
-categories: [content management]
-keywords: [aliases,redirects,permalinks,urls]
-menu:
- docs:
- parent: content-management
- weight: 180
-weight: 180
-toc: true
+categories: []
+keywords: []
aliases: [/extras/permalinks/,/extras/aliases/,/extras/urls/,/doc/redirects/,/doc/alias/,/doc/aliases/]
---
@@ -107,7 +101,7 @@ https://example.org/articles/my-first-article.html
With monolingual sites, `url` values with or without a leading slash are relative to the [`baseURL`]. With multilingual sites, `url` values with a leading slash are relative to the `baseURL`, and `url` values without a leading slash are relative to the `baseURL` plus the language prefix.
-[`baseURL`]: /getting-started/configuration/#baseurl
+[`baseURL`]: /configuration/all/#baseurl
Site type|Front matter `url`|Resulting URL
:--|:--|:--
@@ -120,7 +114,7 @@ multilingual|`about`|`https://example.org/de/about/`
{{< new-in 0.131.0 />}}
-You can also use [tokens](#tokens) when setting the `url` value. This is typically used in `cascade` sections:
+You can also usetokens when setting the `url` value. This is typically used in `cascade` sections:
{{< code-toggle file=content/foo/bar/_index.md fm=true >}}
title ="Bar"
@@ -128,244 +122,19 @@ title ="Bar"
url = "/:sections[last]/:slug"
{{< /code-toggle >}}
+Use any of these tokens:
+
+{{% include "/_common/permalink-tokens.md" %}}
+
## Site configuration
### Permalinks
-In your site configuration, define a URL pattern for each top-level section. Each URL pattern can target a given language and/or page kind.
-
-Front matter `url` values override the URL patterns defined in the `permalinks` section of your site configuration.
-
-#### Monolingual examples {#permalinks-monolingual-examples}
-
-With this content structure:
-
-```text
-content/
-├── posts/
-│ ├── bash-in-slow-motion.md
-│ └── tls-in-a-nutshell.md
-├── tutorials/
-│ ├── git-for-beginners.md
-│ └── javascript-bundling-with-hugo.md
-└── _index.md
-```
-
-Render tutorials under "training", and render the posts under "articles" with a date-base hierarchy:
-
-{{< code-toggle file=hugo >}}
-[permalinks.page]
-posts = '/articles/:year/:month/:slug/'
-tutorials = '/training/:slug/'
-[permalinks.section]
-posts = '/articles/'
-tutorials = '/training/'
-{{< /code-toggle >}}
-
-The structure of the published site will be:
-
-```text
-public/
-├── articles/
-│ ├── 2023/
-│ │ ├── 04/
-│ │ │ └── bash-in-slow-motion/
-│ │ │ └── index.html
-│ │ └── 06/
-│ │ └── tls-in-a-nutshell/
-│ │ └── index.html
-│ └── index.html
-├── training/
-│ ├── git-for-beginners/
-│ │ └── index.html
-│ ├── javascript-bundling-with-hugo/
-│ │ └── index.html
-│ └── index.html
-└── index.html
-```
-
-To create a date-based hierarchy for regular pages in the content root:
-
-{{< code-toggle file=hugo >}}
-[permalinks.page]
-"/" = "/:year/:month/:slug/"
-{{< /code-toggle >}}
-
-Use the same approach with taxonomy terms. For example, to omit the taxonomy segment of the URL:
-
-{{< code-toggle file=hugo >}}
-[permalinks.term]
-'tags' = '/:slug/'
-{{< /code-toggle >}}
-
-#### Multilingual example {#permalinks-multilingual-example}
-
-Use the `permalinks` configuration as a component of your localization strategy.
-
-With this content structure:
-
-```text
-content/
-├── en/
-│ ├── books/
-│ │ ├── les-miserables.md
-│ │ └── the-hunchback-of-notre-dame.md
-│ └── _index.md
-└── es/
- ├── books/
- │ ├── les-miserables.md
- │ └── the-hunchback-of-notre-dame.md
- └── _index.md
-```
-
-And this site configuration:
-
-{{< code-toggle file=hugo >}}
-defaultContentLanguage = 'en'
-defaultContentLanguageInSubdir = true
-
-[languages.en]
-contentDir = 'content/en'
-languageCode = 'en-US'
-languageDirection = 'ltr'
-languageName = 'English'
-weight = 1
-
-[languages.en.permalinks.page]
-books = "/books/:slug/"
-
-[languages.en.permalinks.section]
-books = "/books/"
-
-[languages.es]
-contentDir = 'content/es'
-languageCode = 'es-ES'
-languageDirection = 'ltr'
-languageName = 'Español'
-weight = 2
-
-[languages.es.permalinks.page]
-books = "/libros/:slug/"
-
-[languages.es.permalinks.section]
-books = "/libros/"
-{{< /code-toggle >}}
-
-The structure of the published site will be:
-
-```text
-public/
-├── en/
-│ ├── books/
-│ │ ├── les-miserables/
-│ │ │ └── index.html
-│ │ ├── the-hunchback-of-notre-dame/
-│ │ │ └── index.html
-│ │ └── index.html
-│ └── index.html
-├── es/
-│ ├── libros/
-│ │ ├── les-miserables/
-│ │ │ └── index.html
-│ │ ├── the-hunchback-of-notre-dame/
-│ │ │ └── index.html
-│ │ └── index.html
-│ └── index.html
-└── index.html
-````
-
-#### Tokens
-
-Use these tokens when defining the URL pattern. You can also use these tokens when setting the [`url`](#permalinks-tokens-in-front-matter) value in front matter.
-
-`:year`
-: The 4-digit year as defined in the front matter `date` field.
-
-`:month`
-: The 2-digit month as defined in the front matter `date` field.
-
-`:monthname`
-: The name of the month as defined in the front matter `date` field.
-
-`:day`
-: The 2-digit day as defined in the front matter `date` field.
-
-`:weekday`
-: The 1-digit day of the week as defined in the front matter `date` field (Sunday = 0).
-
-`:weekdayname`
-: The name of the day of the week as defined in the front matter `date` field.
-
-`:yearday`
-: The 1- to 3-digit day of the year as defined in the front matter `date` field.
-
-`:section`
-: The content's section.
-
-`:sections`
-: The content's sections hierarchy. You can use a selection of the sections using _slice syntax_: `:sections[1:]` includes all but the first, `:sections[:last]` includes all but the last, `:sections[last]` includes only the last, `:sections[1:2]` includes section 2 and 3. Note that this slice access will not throw any out-of-bounds errors, so you don't have to be exact.
-
-`:title`
-: The `title` as defined in front matter, else the automatic title. Hugo generates titles automatically for section, taxonomy, and term pages that are not backed by a file.
-
-`:slug`
-: The `slug` as defined in front matter, else the `title` as defined in front matter, else the automatic title. Hugo generates titles automatically for section, taxonomy, and term pages that are not backed by a file.
-
-`:filename`
-: The content's file name without extension, applicable to the `page` page kind.
-
- {{< deprecated-in v0.144.0 >}}
- The `:filename` token has been deprecated. Use `:contentbasename` instead.
- {{< /deprecated-in >}}
-
-`:slugorfilename`
-: The `slug` as defined in front matter, else the content's file name without extension, applicable to the `page` page kind.
-
- {{< deprecated-in v0.144.0 >}}
- The `:slugorfilename` token has been deprecated. Use `:slugorcontentbasename` instead.
- {{< /deprecated-in >}}
-
-`:contentbasename`
-: {{< new-in 0.144.0 />}}
-: The [content base name].
-
-[content base name]: /methods/page/file/#contentbasename
-
-`:slugorcontentbasename`
-: {{< new-in 0.144.0 />}}
-: The `slug` as defined in front matter, else the [content base name].
-
-For time-related values, you can also use the layout string components defined in Go's [time package]. For example:
-
-[time package]: https://pkg.go.dev/time#pkg-constants
-
-{{< code-toggle file=hugo >}}
-permalinks:
- posts: /:06/:1/:2/:title/
-{{< /code-toggle >}}
+See [configure permalinks](/configuration/permalinks).
### Appearance
-The appearance of a URL is either ugly or pretty.
-
-Type|Path|URL
-:--|:--|:--
-ugly|content/about.md|`https://example.org/about.html`
-pretty|content/about.md|`https://example.org/about/`
-
-By default, Hugo produces pretty URLs. To generate ugly URLs, change your site configuration:
-
-{{< code-toggle file=hugo >}}
-uglyURLs = true
-{{< /code-toggle >}}
-
-You can also enable uglyURLs by section. For example, with a site that contains sections for books and films:
-
-{{< code-toggle file=hugo >}}
-[uglyURLs]
-books = true
-films = false
-{{< /code-toggle >}}
+See [configure ugly URLs](/configuration/ugly-urls/).
### Post-processing
diff --git a/content/en/contribute/_index.md b/content/en/contribute/_index.md
index a8ffaf4fa..d0ae954b0 100644
--- a/content/en/contribute/_index.md
+++ b/content/en/contribute/_index.md
@@ -1,16 +1,9 @@
---
title: Contribute to the Hugo project
-linktitle: Contribute
+linkTitle: Contribute
description: Contribute to development, documentation, and themes.
categories: []
keywords: []
-menu:
- docs:
- identifier: contribute-in-this-section
- parent: contribute
- weight: 10
weight: 10
aliases: [/tutorials/how-to-contribute-to-hugo/,/community/contributing/]
---
-
-Hugo relies heavily on the enthusiasm and participation of the open-source community. We need your support.
diff --git a/content/en/contribute/development.md b/content/en/contribute/development.md
index cde48a4c8..b4e669772 100644
--- a/content/en/contribute/development.md
+++ b/content/en/contribute/development.md
@@ -1,14 +1,8 @@
---
title: Development
description: Contribute to the development of Hugo.
-categories: [contribute]
-keywords: [development]
-menu:
- docs:
- parent: contribute
- weight: 20
-weight: 20
-toc: true
+categories: []
+keywords: []
---
## Introduction
@@ -70,16 +64,17 @@ This section assumes that you have a working knowledge of Go, Git and GitHub, an
Use this workflow to create and submit pull requests.
-Step 1
-: Fork the [project repository].
+### Step 1
-[project repository]: https://github.com/gohugoio/hugo/
+Fork the [project repository].
-Step 2
-: Clone your fork.
+### Step 2
-Step 3
-: Create a new branch with a descriptive name that includes the corresponding issue number.
+Clone your fork.
+
+### Step 3
+
+Create a new branch with a descriptive name that includes the corresponding issue number.
For a new feature:
@@ -93,11 +88,13 @@ For a bug fix:
git checkout -b fix/fix-some-bug-99999
```
-Step 4
-: Make changes.
+### Step 4
-Step 5
-: Compile and install.
+Make changes.
+
+### Step 5
+
+Compile and install.
To compile and install the standard edition:
@@ -117,22 +114,22 @@ To compile and install the extended/deploy edition:
CGO_ENABLED=1 go install -tags extended,withdeploy
```
-Step 6
-: Test your changes:
+### Step 6
+
+Test your changes:
```text
go test ./...
```
-Step 7
-: Commit your changes with a descriptive commit message:
+### Step 7
+
+Commit your changes with a descriptive commit message:
- Provide a summary on the first line, typically 50 characters or less, followed by a blank line.
- Optionally, provide a detailed description where each line is 80 characters or less, followed by a blank line.
- Add one or more "Fixes" or "Closes" keywords, each on its own line, referencing the [issues] addressed by this change.
-[issues]: https://github.com/gohugoio/hugo/issues
-
For example:
```sh
@@ -148,16 +145,21 @@ Closes #99999"
See the [commit message guidelines] for details.
+### Step 8
+
+Push the new branch to your fork of the documentation repository.
+
+### Step 9
+
+Visit the [project repository] and create a pull request (PR).
+
+### Step 10
+
+A project maintainer will review your PR and may request changes. You may delete your branch after the maintainer merges your PR.
+
[commit message guidelines]: https://github.com/gohugoio/hugo/blob/master/CONTRIBUTING.md#git-commit-message-guidelines
-
-Step 8
-: Push the new branch to your fork of the documentation repository.
-
-Step 9
-: Visit the [project repository] and create a pull request (PR).
-
-Step 10
-: A project maintainer will review your PR and may request changes. You may delete your branch after the maintainer merges your PR.
+[issues]: https://github.com/gohugoio/hugo/issues
+[project repository]: https://github.com/gohugoio/hugo/
## Building from source
@@ -172,7 +174,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.141.0
+CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@v0.144.2
```
To build and install at the latest commit on the master branch:
diff --git a/content/en/contribute/documentation.md b/content/en/contribute/documentation.md
index 61643fcf0..51f78a0d4 100644
--- a/content/en/contribute/documentation.md
+++ b/content/en/contribute/documentation.md
@@ -1,59 +1,48 @@
---
title: Documentation
description: Help us to improve the documentation by identifying issues and suggesting changes.
-categories: [contribute]
-keywords: [documentation]
-menu:
- docs:
- parent: contribute
- weight: 30
-weight: 30
-toc: true
+categories: []
+keywords: []
aliases: [/contribute/docs/]
---
## Introduction
-We welcome corrections and improvements to the documentation. Please note that the documentation resides in its own repository, separate from the project repository.
+We welcome corrections and improvements to the documentation. The documentation lives in a separate repository from the main project. To contribute:
-For corrections and improvements to the current documentation, please submit issues and pull requests to the [documentation repository].
-
-For documentation related to a new feature, please include the documentation changes when you submit a pull request to the [project repository].
+- For corrections and improvements to existing documentation, submit issues and pull requests to the [documentation repository].
+- For documentation of new features, include the documentation changes in your pull request to the [project repository].
## Guidelines
### Style
-Please adhere to Google's [developer documentation style guide].
+Follow Google's [developer documentation style guide].
[developer documentation style guide]: https://developers.google.com/style
### Markdown
-Please follow these guidelines:
+Adhere to these Markdown conventions:
-- Use [ATX] headings, not [setext] headings, levels 2 through 4
-- Use [fenced code blocks], not [indented code blocks]
-- Use hyphens, not asterisks, with unordered [list items]
-- Use the [note shortcode] instead of blockquotes or bold text
-- Do not mix [raw HTML] within Markdown
-- Do not use bold text instead of a heading or description term (`dt`)
-- Remove consecutive blank lines (maximum of two)
-- Remove trailing spaces
+- Use [ATX] headings (levels 2-4), not [setext] headings.
+- Use [fenced code blocks], not [indented code blocks].
+- Use hyphens, not asterisks, for unordered [list items].
+- Use the [note shortcode] instead of blockquotes or bold text for emphasis.
+- Do not mix [raw HTML] within Markdown.
+- Do not use bold text in place of a heading or description term (`dt`).
+- Remove consecutive blank lines (limit to two).
+- Remove trailing spaces.
### Glossary
-Glossary terms are maintained on individual pages. While not directly accessible to site visitors, these pages act as a central repository for term definitions.
+[Glossary] terms are defined on individual pages, providing a central repository for definitions, though these pages are not directly linked from the site.
-Definitions must be presented in complete sentences, with the first sentence always introducing the term being defined. To enhance readability and consistency, the first occurrence of the term and any other referenced glossary terms should be italicized.
+Definitions must be complete sentences, with the first sentence defining the term. Italicize the first occurrence of the term and any referenced glossary terms for consistency.
-To link to a term definition on the glossary page, use this custom link syntax:
+Link to glossary terms using this syntax: `[term](g)`
-```text
-[term](g)
-```
-
-Lookups are case-insensitive, ignore formatting, and support both singular and plural forms. For example, all of these variations will link to the same glossary term:
+Term lookups are case-insensitive, ignore formatting, and support singular and plural forms. For example, all of these variations will link to the same glossary term:
```text
[global resource](g)
@@ -62,7 +51,7 @@ Lookups are case-insensitive, ignore formatting, and support both singular and p
[`Global Resources`](g)
```
-To insert a term definition, use the [`glossary-term`] shortcode:
+Use the glossary-term shortcode to insert a term definition:
```text
{{%/* glossary-term "global resource" */%}}
@@ -70,29 +59,27 @@ To insert a term definition, use the [`glossary-term`] shortcode:
### Terminology
-Please link to the glossary (see above) when necessary, and use the terms consistently throughout the documentation. Of special note:
+Link to the [glossary] as needed and use terms consistently. Pay particular attention to:
-- The term "front matter" is two words unless you are referring to the configuration key
-- The term "home page" is two words
-- The term "website" is one word
-- The term "standalone" is one word, not hyphenated
-- Use the word "map" instead of "dictionary"
-- Use the word "flag" instead of "option" when referring to a command line flag
-- Use "client side" as a noun, and "client-side" as an adjective
-- Capitalize the word "Markdown"
-- Hyphenate the term "open-source" when used an adjective.
+- "front matter" (two words, except when referring to the configuration key)
+- "home page" (two words)
+- "website" (one word)
+- "standalone" (one word, no hyphen)
+- "map" (instead of "dictionary")
+- "flag" (instead of "option" for command-line flags)
+- "client side" (noun), "client-side" (adjective)
+- "Markdown" (capitalized)
+- "open-source" (hyphenated adjective)
-### Page titles and headings
+### Titles and headings
-Please follow these guidelines for page titles and headings:
+- Use sentence-style capitalization.
+- Avoid formatted strings.
+- Keep them concise.
-- Use sentence-style capitalization
-- Avoid formatted strings in headings and page titles
-- Shorter is better
+### Writing style
-### Use active voice with present tense
-
-In software documentation, passive voice is unavoidable in some cases. Please use active voice when possible.
+Use active voice and present tense wherever possible.
No → With Hugo you can build a static site.\
Yes → Build a static site with Hugo.
@@ -100,13 +87,13 @@ Yes → Build a static site with Hugo.
No → This will cause Hugo to generate HTML files in the `public` directory.\
Yes → Hugo generates HTML files in the `public` directory.
-### Use second person instead of third person
+Use second person instead of third person.
No → Users should exercise caution when deleting files.\
Better → You must be cautious when deleting files.\
Best → Be cautious when deleting files.
-### Avoid adverbs when possible
+Minimize adverbs.
No → Hugo is extremely fast.\
Yes → Hugo is fast.
@@ -115,50 +102,49 @@ Yes → Hugo is fast.
"It's an adverb, Sam. It's a lazy tool of a weak mind." (Outbreak, 1995).
{{< /note >}}
-### Level 6 headings
-
-Level 6 headings are styled as `dt` elements. This was implemented to support a [glossary] with linkable terms.
-
### Function and method descriptions
-When adding a page to the [functions] or [methods] section, begin the description with the word "Returns". With functions and methods that return a boolean value, begin the description with the phrase "Reports whether".
-
-For example:
-
-- `Returns the URL aliases as defined in front matter.`
-- `Reports whether the given page is in the given section.`
+Start descriptions in the functions and methods sections with "Returns" or "Reports whether" (for boolean values).
[functions]: /functions
[methods]: /methods
-### Directory names, file names, and file paths
+### File paths and names
-Enclose directory names, file names, and file paths within backticks, with the following exceptions:
+Enclose directory names, file names, and file paths in backticks, except when used in:
- Page titles
- Section headings (h1-h6)
- Definition list terms
-- The description field in front matter
+- The `description` field in front matter
### Miscellaneous
-Other guidelines to consider:
+Other best practices:
-- Do not place list items directly under a heading; include an introductory sentence or phrase before the list.
-- Avoid use of **bold** text. Use the [note shortcode] to draw attention to important content.
-- Do not place description terms (`dt`) within backticks unless required for syntactic clarity.
-- Do not use Hugo's `ref` or `relref` shortcodes. We use a link render hook to resolve and validate link destinations, including fragments.
-- Shorter is better. If there is more than one way to do something, describe the current best practice. For example, avoid phrases such as "you can also do..." and "in older versions you had to..."
-- When including code samples, use short snippets that demonstrate the concept.
-- The Hugo user community is global; use [basic english](https://simple.wikipedia.org/wiki/Basic_English) when possible.
+- Introduce lists with a sentence or phrase, not directly under a heading.
+- Avoid bold text; use the note shortcode for emphasis.
+- Do not put description terms (`dt`) in backticks unless syntactically necessary.
+- Do not use Hugo's `ref` or `relref` shortcodes.
+- Prioritize current best practices over multiple options or historical - information.
+- Use short, focused code examples.
+- Use [basic english] where possible for a global audience.
+
+[basic english]: https://simple.wikipedia.org/wiki/Basic_English
## Code examples
-Indent code by two spaces. With examples of template code, include a space after opening action delimiters, and include a space before closing action delimiters.
+Indent code by two spaces. With examples of template code, ddd spaces around template code action delimiters:
+
+```go-html-template
+{{ if eq $foo $bar }}
+ {{ fmt.Printf "%s is %s" $foo $bar }}
+{{ end }}
+```
### Fenced code blocks
-Always include the language code when using a fenced code block:
+Always specify the language:
````text
```go-html-template
@@ -168,25 +154,16 @@ Always include the language code when using a fenced code block:
```
````
-```go-html-template
-{{ if eq $foo "bar" }}
- {{ print "foo is bar" }}
-{{ end }}
-```
-
### Shortcode calls
-Use this syntax to include shortcodes calls within your code examples:
+Use this syntax :
+````text
```text
{{*/* foo */*/>}}
{{%/*/* foo */*/%}}
```
-
-```text
-{{* foo */>}}
-{{%/* foo */%}}
-```
+````
### Site configuration
@@ -200,12 +177,6 @@ title = 'My Site'
{{* /code-toggle */>}}
```
-{{< code-toggle file=hugo >}}
-baseURL = 'https://example.org/'
-languageCode = 'en-US'
-title = 'My Site'
-{{< /code-toggle >}}
-
### Front matter
Use the [code-toggle shortcode] to include front matter examples:
@@ -218,15 +189,9 @@ draft = false
{{* /code-toggle */>}}
```
-{{< code-toggle file=content/posts/my-first-post.md fm=true >}}
-title = 'My first post'
-date = 2023-11-09T12:56:07-08:00
-draft = false
-{{< /code-toggle >}}
-
### Other code examples
-Use the [code shortcode] for other code examples that require a file name:
+Use the [code shortcode] for code examples that require a file name:
```text
{{* code file=layouts/_default/single.html */>}}
@@ -236,19 +201,13 @@ Use the [code shortcode] for other code examples that require a file name:
{{* /code */>}}
```
-{{< code file=layouts/_default/single.html >}}
-{{ range .Site.RegularPages }}
- {{ .LinkTitle }}
-{{ end }}
-{{< /code >}}
-
## Shortcodes
These shortcodes are commonly used throughout the documentation. Other shortcodes are available for specialized use.
### code
-Use the `code` shortcode for other code examples that require a file name. See the [code examples] above. This shortcode takes these arguments:
+Use the `code` shortcode for code examples that require a file name. This shortcode takes these arguments:
copy
: (`bool`) Whether to display a copy-to-clipboard button. Default is `false`.
@@ -264,14 +223,9 @@ lang
Some code here
{{* /code */>}}
```
-
-{{< code file=content/something/foo.md lang=text copy=true >}}
-Some code here
-{{< /code >}}
-
### code-toggle
-Use the `code-toggle` shortcode to display examples of site configuration, front matter, or data files. See the [code examples] above. This shortcode takes these arguments:
+Use the `code-toggle` shortcode to display examples of site configuration, front matter, or data files. This shortcode takes these arguments:
config
: (`string`) The section of `site.Data.docs.config` to render.
@@ -280,44 +234,35 @@ copy
: (`bool`) Whether to display a copy-to-clipboard button. Default is `false`.
file
-: (`string`) The file name to display. Omit the file extension for site configuration examples. Default is `hugo`
+: (`string`) The file name to display. Omit the file extension for site configuration examples.
fm
: (`bool`) Whether the example is 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 `site.Data.docs.config`.
```text
-{{* code-toggle */>}}
-title: Example
-draft: false
+{{* code-toggle file=hugo copy=true */>}}
+baseURL = 'https://example.org/'
+languageCode = 'en-US'
+title = 'My Site'
{{* /code-toggle */>}}
```
-{{< code-toggle >}}
-title: Example
-draft: false
-{{< /code-toggle >}}
-
### deprecated-in
Use the `deprecated-in` shortcode to indicate that a feature is deprecated:
```text
{{* deprecated-in 0.144.0 */>}}
+
Use [`hugo.IsServer`] instead.
[`hugo.IsServer`]: /functions/hugo/isserver/
{{* /deprecated-in */>}}
```
-{{< deprecated-in 0.144.0 >}}
-Use [`hugo.IsServer`] instead.
-
-[`hugo.IsServer`]: /functions/hugo/isserver/
-{{< /deprecated-in >}}
-
### eturl
Use the embedded template URL (`eturl`) shortcode to insert an absolute URL to the source code for an embedded template. The shortcode takes a single argument, the base file name of the template (omit the file extension).
@@ -328,10 +273,6 @@ This is a link to the [embedded alias template].
[embedded alias template]: {{%/* eturl alias */%}}
```
-This is a link to the [embedded alias template].
-
-[embedded alias template]: {{% eturl alias %}}
-
### glossary-term
Use the `glossary-term` shortcode to insert the definition of the given glossary term.
@@ -340,14 +281,12 @@ Use the `glossary-term` shortcode to insert the definition of the given glossary
{{%/* glossary-term scalar */%}}
```
-{{% glossary-term scalar %}}
-
### include
Use the `include` shortcode to include content from another page.
```text
-{{%/* include "functions/_common/glob-patterns" */%}}
+{{%/* include "_common/glob-patterns.md" */%}}
```
### new-in
@@ -355,10 +294,16 @@ Use the `include` shortcode to include content from another page.
Use the `new-in` shortcode to indicate a new feature:
```text
-{{* new-in 0.127.0 */>}}
+{{* new-in 0.144.0 /*/>}}
```
-{{< new-in 0.127.0 />}}
+You can also include details:
+
+```text
+{{* new-in 0.144.0 */>}}
+This is a new feature.
+{{* /new-in */>}}
+```
### note
@@ -372,38 +317,32 @@ Use the [`math.Mod`] function to control...
{{* /note */>}}
```
-{{< note >}}
-Use the [`math.Mod`] function to control...
-
-[`math.Mod`]: /functions/math/mod/
-{{< /note >}}
-
## New features
-Use the "new-in" shortcode to indicate a new feature:
+Use the [`new-in`](#new-in) shortcode to indicate a new feature:
-{{< code file=content/something/foo.md lang=text >}}
-{{* new-in 0.120.0 */>}}
-{{< /code >}}
+```text
+{{* new-in 0.144.0 */>}}
+```
The "new in" label will be hidden if the specified version is older than a predefined threshold, based on differences in major and minor versions. See [details](https://github.com/gohugoio/hugoDocs/blob/master/_vendor/github.com/gohugoio/gohugoioTheme/layouts/shortcodes/new-in.html).
## Deprecated features
-Use the "deprecated-in" shortcode to indicate that a feature is deprecated:
+Use the [`deprecated-in`](#deprecated-in) shortcode to indicate that a feature is deprecated:
-{{< code file=content/something/foo.md >}}
+```text
{{* deprecated-in 0.144.0 */>}}
Use [`hugo.IsServer`] instead.
[`hugo.IsServer`]: /functions/hugo/isserver/
{{* /deprecated-in */>}}
-{{< /code >}}
+```
When deprecating a function or method, add something like this to front matter:
{{< code-toggle file=content/something/foo.md fm=true >}}
-expiryDate: 2024-10-30 # deprecated 2022-10-30 in v0.123.0
+expiryDate: 2027-02-17 # deprecated 2025-02-17 in v0.144.0
{{< /code-toggle >}}
Set the `expiryDate` to two years from the date of deprecation, and add a brief front matter comment to explain the setting.
@@ -416,27 +355,33 @@ This section assumes that you have a working knowledge of Git and GitHub, and ar
Use this workflow to create and submit pull requests.
-Step 1
-: Fork the [documentation repository].
+### Step 1
-Step 2
-: Clone your fork.
+Fork the [documentation repository].
-Step 3
-: Create a new branch with a descriptive name that includes the corresponding issue number, if any:
+### Step 2
+
+Clone your fork.
+
+### Step 3
+
+Create a new branch with a descriptive name that includes the corresponding issue number, if any:
```sh
git checkout -b restructure-foo-page-99999
```
-Step 4
-: Make changes.
+### Step 4
-Step 5
-: Build the site locally to preview your changes.
+Make changes.
-Step 6
-: Commit your changes with a descriptive commit message:
+### Step 5
+
+Build the site locally to preview your changes.
+
+### Step 6
+
+Commit your changes with a descriptive commit message:
- Provide a summary on the first line, typically 50 characters or less, followed by a blank line.
- Optionally, provide a detailed description where each line is 80 characters or less, followed by a blank line.
@@ -444,7 +389,7 @@ Step 6
For example:
-```sh
+```text
git commit -m "Restructure the taxonomy page
This restructures the taxonomy page by splitting topics into logical
@@ -454,14 +399,17 @@ Fixes #9999
Closes #9998"
```
-Step 7
-: Push the new branch to your fork of the documentation repository.
+### Step 7
-Step 8
-: Visit the [documentation repository] and create a pull request (PR).
+Push the new branch to your fork of the documentation repository.
-Step 9
-: A project maintainer will review your PR and may request changes. You may delete your branch after the maintainer merges your PR.
+### Step 8
+
+Visit the [documentation repository] and create a pull request (PR).
+
+### Step 9
+
+A project maintainer will review your PR and may request changes. You may delete your branch after the maintainer merges your PR.
[ATX]: https://spec.commonmark.org/0.30/#atx-headings
[Microsoft Writing Style Guide]: https://learn.microsoft.com/en-us/style-guide/welcome/
diff --git a/content/en/contribute/themes.md b/content/en/contribute/themes.md
index 7277e2927..8a3457ba3 100644
--- a/content/en/contribute/themes.md
+++ b/content/en/contribute/themes.md
@@ -1,13 +1,8 @@
---
title: Themes
description: If you've built a Hugo theme and want to contribute back to the Hugo Community, please share it with us.
-categories: [contribute]
-keywords: [themes]
-menu:
- docs:
- parent: contribute
- weight: 40
-weight: 40
+categories: []
+keywords: []
aliases: [/contribute/theme/]
---
diff --git a/content/en/documentation.md b/content/en/documentation.md
index 11f843f91..6f96c1f9c 100644
--- a/content/en/documentation.md
+++ b/content/en/documentation.md
@@ -2,21 +2,19 @@
title: Hugo Documentation
linkTitle: Docs
description: Hugo is the world's fastest static website engine. It's written in Go (aka Golang) and developed by bep, spf13 and friends.
-menu:
- main:
- weight: 1
-weight: 1
layout: list
---
-A fast and flexible [static site generator] built with love by [bep], [spf13], and [friends] in [Go].
+
diff --git a/content/en/functions/_common/_index.md b/content/en/functions/_common/_index.md
deleted file mode 100644
index 4328d4d14..000000000
--- a/content/en/functions/_common/_index.md
+++ /dev/null
@@ -1,13 +0,0 @@
----
-cascade:
- _build:
- list: never
- publishResources: false
- render: never
----
-
-
diff --git a/content/en/functions/_index.md b/content/en/functions/_index.md
index 95d766b13..d3081210b 100644
--- a/content/en/functions/_index.md
+++ b/content/en/functions/_index.md
@@ -1,17 +1,8 @@
---
title: Functions
-
description: Use these functions within your templates and archetypes.
categories: []
keywords: []
-menu:
- docs:
- identifier: functions-in-this-section
- parent: functions
- weight: 10
weight: 10
-showSectionMenu: true
aliases: [/layout/functions/,/templates/functions]
---
-
-Use these functions within your templates and archetypes.
diff --git a/content/en/functions/cast/ToFloat.md b/content/en/functions/cast/ToFloat.md
index 51bc908b6..2f5afd61d 100644
--- a/content/en/functions/cast/ToFloat.md
+++ b/content/en/functions/cast/ToFloat.md
@@ -3,13 +3,14 @@ title: cast.ToFloat
description: Converts a value to a decimal floating-point number (base 10).
categories: []
keywords: []
-action:
- aliases: [float]
- related:
- - functions/cast/ToInt
- - functions/cast/ToString
- returnType: float64
- signatures: [cast.ToFloat INPUT]
+params:
+ functions_and_methods:
+ aliases: [float]
+ related:
+ - functions/cast/ToInt
+ - functions/cast/ToString
+ returnType: float64
+ signatures: [cast.ToFloat INPUT]
aliases: [/functions/float]
---
diff --git a/content/en/functions/cast/ToInt.md b/content/en/functions/cast/ToInt.md
index 3e272cba4..2d97b8d84 100644
--- a/content/en/functions/cast/ToInt.md
+++ b/content/en/functions/cast/ToInt.md
@@ -2,13 +2,14 @@
title: cast.ToInt
description: Converts a value to a decimal integer (base 10).
keywords: []
-action:
- aliases: [int]
- related:
- - functions/cast/ToFloat
- - functions/cast/ToString
- returnType: int
- signatures: [cast.ToInt INPUT]
+params:
+ functions_and_methods:
+ aliases: [int]
+ related:
+ - functions/cast/ToFloat
+ - functions/cast/ToString
+ returnType: int
+ signatures: [cast.ToInt INPUT]
aliases: [/functions/int]
---
diff --git a/content/en/functions/cast/ToString.md b/content/en/functions/cast/ToString.md
index a701c9421..f90ef14c0 100644
--- a/content/en/functions/cast/ToString.md
+++ b/content/en/functions/cast/ToString.md
@@ -3,13 +3,14 @@ title: cast.ToString
description: Converts a value to a string.
categories: []
keywords: []
-action:
- aliases: [string]
- related:
- - functions/cast/ToFloat
- - functions/cast/ToInt
- returnType: string
- signatures: [cast.ToString INPUT]
+params:
+ functions_and_methods:
+ aliases: [string]
+ related:
+ - functions/cast/ToFloat
+ - functions/cast/ToInt
+ returnType: string
+ signatures: [cast.ToString INPUT]
aliases: [/functions/string]
---
diff --git a/content/en/functions/cast/_index.md b/content/en/functions/cast/_index.md
index 82389237a..1584ab159 100644
--- a/content/en/functions/cast/_index.md
+++ b/content/en/functions/cast/_index.md
@@ -1,12 +1,7 @@
---
title: Cast functions
linkTitle: cast
-description: Template functions to cast a value from one data type to another.
+description: Use these functions to cast a value from one data type to another.
categories: []
keywords: []
-menu:
- docs:
- parent: functions
---
-
-Use these functions to cast a value from one data type to another.
diff --git a/content/en/functions/collections/After.md b/content/en/functions/collections/After.md
index 1f2759da6..909836030 100644
--- a/content/en/functions/collections/After.md
+++ b/content/en/functions/collections/After.md
@@ -3,13 +3,14 @@ title: collections.After
description: Slices an array to the items after the Nth item.
categories: []
keywords: []
-action:
- aliases: [after]
- related:
- - functions/collections/First
- - functions/collections/Last
- returnType: any
- signatures: [collections.After INDEX COLLECTION]
+params:
+ functions_and_methods:
+ aliases: [after]
+ related:
+ - functions/collections/First
+ - functions/collections/Last
+ returnType: any
+ signatures: [collections.After INDEX COLLECTION]
aliases: [/functions/after]
---
diff --git a/content/en/functions/collections/Append.md b/content/en/functions/collections/Append.md
index 7189c9068..fd37305d2 100644
--- a/content/en/functions/collections/Append.md
+++ b/content/en/functions/collections/Append.md
@@ -3,14 +3,15 @@ title: collections.Append
description: Appends one or more elements to a slice and returns the resulting slice.
categories: []
keywords: []
-action:
- aliases: [append]
- related:
- - functions/collections/Merge
- returnType: any
- signatures:
- - collections.Append ELEMENT [ELEMENT...] COLLECTION
- - collections.Append COLLECTION1 COLLECTION2
+params:
+ functions_and_methods:
+ aliases: [append]
+ related:
+ - functions/collections/Merge
+ returnType: any
+ signatures:
+ - collections.Append ELEMENT [ELEMENT...] COLLECTION
+ - collections.Append COLLECTION1 COLLECTION2
aliases: [/functions/append]
---
diff --git a/content/en/functions/collections/Apply.md b/content/en/functions/collections/Apply.md
index 9153e546a..6d8c5c8d4 100644
--- a/content/en/functions/collections/Apply.md
+++ b/content/en/functions/collections/Apply.md
@@ -3,11 +3,12 @@ title: collections.Apply
description: Returns a new collection with each element transformed by the given function.
categories: []
keywords: []
-action:
- aliases: [apply]
- related: []
- returnType: '[]any'
- signatures: [collections.Apply COLLECTION FUNCTION PARAM...]
+params:
+ functions_and_methods:
+ aliases: [apply]
+ related: []
+ returnType: '[]any'
+ signatures: [collections.Apply COLLECTION FUNCTION PARAM...]
aliases: [/functions/apply]
---
diff --git a/content/en/functions/collections/Complement.md b/content/en/functions/collections/Complement.md
index b4c59822d..44235f4eb 100644
--- a/content/en/functions/collections/Complement.md
+++ b/content/en/functions/collections/Complement.md
@@ -3,14 +3,15 @@ title: collections.Complement
description: Returns the elements of the last collection that are not in any of the others.
categories: []
keywords: []
-action:
- aliases: [complement]
- related:
- - functions/collections/Intersect
- - functions/collections/SymDiff
- - functions/collections/Union
- returnType: any
- signatures: ['collections.Complement COLLECTION [COLLECTION...]']
+params:
+ functions_and_methods:
+ aliases: [complement]
+ related:
+ - functions/collections/Intersect
+ - functions/collections/SymDiff
+ - functions/collections/Union
+ returnType: any
+ signatures: ['collections.Complement COLLECTION [COLLECTION...]']
aliases: [/functions/complement]
---
diff --git a/content/en/functions/collections/Delimit.md b/content/en/functions/collections/Delimit.md
index 6370ca17d..b403c5b43 100644
--- a/content/en/functions/collections/Delimit.md
+++ b/content/en/functions/collections/Delimit.md
@@ -3,12 +3,13 @@ title: collections.Delimit
description: Loops through any array, slice, or map and returns a string of all the values separated by a delimiter.
categories: []
keywords: []
-action:
- aliases: [delimit]
- related:
- - functions/strings/Split
- returnType: string
- signatures: ['collections.Delimit COLLECTION DELIMITER [LAST]']
+params:
+ functions_and_methods:
+ aliases: [delimit]
+ related:
+ - functions/strings/Split
+ returnType: string
+ signatures: ['collections.Delimit COLLECTION DELIMITER [LAST]']
aliases: [/functions/delimit]
---
diff --git a/content/en/functions/collections/Dictionary.md b/content/en/functions/collections/Dictionary.md
index a55838e27..cc99d4aed 100644
--- a/content/en/functions/collections/Dictionary.md
+++ b/content/en/functions/collections/Dictionary.md
@@ -3,12 +3,13 @@ title: collections.Dictionary
description: Returns a map composed of the given key-value pairs.
categories: []
keywords: []
-action:
- aliases: [dict]
- related:
- - functions/collections/Slice
- returnType: map[string]any
- signatures: ['collections.Dictionary [VALUE...]']
+params:
+ functions_and_methods:
+ aliases: [dict]
+ related:
+ - functions/collections/Slice
+ returnType: map[string]any
+ signatures: ['collections.Dictionary [VALUE...]']
aliases: [/functions/dict]
---
diff --git a/content/en/functions/collections/First.md b/content/en/functions/collections/First.md
index 07634d6b8..ec46e3b3d 100644
--- a/content/en/functions/collections/First.md
+++ b/content/en/functions/collections/First.md
@@ -3,14 +3,15 @@ title: collections.First
description: Returns the given collection, limited to the first N elements.
categories: []
keywords: []
-action:
- aliases: [first]
- related:
- - functions/collections/After
- - functions/collections/Last
- - methods/pages/Limit
- returnType: any
- signatures: [collections.First N COLLECTION]
+params:
+ functions_and_methods:
+ aliases: [first]
+ related:
+ - functions/collections/After
+ - functions/collections/Last
+ - methods/pages/Limit
+ returnType: any
+ signatures: [collections.First N COLLECTION]
aliases: [/functions/first]
---
@@ -23,7 +24,7 @@ aliases: [/functions/first]
Set `N` to zero to return an empty collection.
```go-html-template
-{{ $emptyPageCollection := first 0 .Pages}}
+{{ $emptyPageCollection := first 0 .Pages }}
```
Use `first` and [`where`] together.
diff --git a/content/en/functions/collections/Group.md b/content/en/functions/collections/Group.md
index 0ec45516c..dc2c227f8 100644
--- a/content/en/functions/collections/Group.md
+++ b/content/en/functions/collections/Group.md
@@ -3,11 +3,12 @@ title: collections.Group
description: Groups the given page collection by the given key.
categories: []
keywords: []
-action:
- aliases: [group]
- related: []
- returnType: any
- signatures: [collections.Group KEY PAGES]
+params:
+ functions_and_methods:
+ aliases: [group]
+ related: []
+ returnType: any
+ signatures: [collections.Group KEY PAGES]
aliases: [/functions/group]
---
diff --git a/content/en/functions/collections/In.md b/content/en/functions/collections/In.md
index 754c65f83..dbe7d5e4d 100644
--- a/content/en/functions/collections/In.md
+++ b/content/en/functions/collections/In.md
@@ -3,16 +3,17 @@ title: collections.In
description: Reports whether the given value is a member of the given set.
categories: []
keywords: []
-action:
- aliases: [in]
- related:
- - functions/strings/Contains
- - functions/strings/ContainsAny
- - functions/strings/ContainsNonSpace
- - functions/strings/HasPrefix
- - functions/strings/HasSuffix
- returnType: bool
- signatures: [collections.In SET VALUE]
+params:
+ functions_and_methods:
+ aliases: [in]
+ related:
+ - functions/strings/Contains
+ - functions/strings/ContainsAny
+ - functions/strings/ContainsNonSpace
+ - functions/strings/HasPrefix
+ - functions/strings/HasSuffix
+ returnType: bool
+ signatures: [collections.In SET VALUE]
aliases: [/functions/in]
---
diff --git a/content/en/functions/collections/IndexFunction.md b/content/en/functions/collections/IndexFunction.md
index 977e14d1e..439e0cd49 100644
--- a/content/en/functions/collections/IndexFunction.md
+++ b/content/en/functions/collections/IndexFunction.md
@@ -3,12 +3,12 @@ title: collections.Index
description: Returns the object, element, or value associated with the given key or keys.
categories: []
keywords: []
-action:
- aliases: [index]
- related: []
- returnType: any
- signatures:
- - collections.Index COLLECTION KEY...
+params:
+ functions_and_methods:
+ aliases: [index]
+ related: []
+ returnType: any
+ signatures: [collections.Index COLLECTION KEY...]
aliases: [/functions/index,/functions/index-function]
---
diff --git a/content/en/functions/collections/Intersect.md b/content/en/functions/collections/Intersect.md
index 9e9cc0c76..4c4b44784 100644
--- a/content/en/functions/collections/Intersect.md
+++ b/content/en/functions/collections/Intersect.md
@@ -3,14 +3,15 @@ title: collections.Intersect
description: Returns the common elements of two arrays or slices, in the same order as the first array.
categories: []
keywords: []
-action:
- aliases: [intersect]
- related:
- - functions/collections/Complement
- - functions/collections/SymDiff
- - functions/collections/Union
- returnType: any
- signatures: [collections.Intersect SET1 SET2]
+params:
+ functions_and_methods:
+ aliases: [intersect]
+ related:
+ - functions/collections/Complement
+ - functions/collections/SymDiff
+ - functions/collections/Union
+ returnType: any
+ signatures: [collections.Intersect SET1 SET2]
aliases: [/functions/intersect]
---
diff --git a/content/en/functions/collections/IsSet.md b/content/en/functions/collections/IsSet.md
index 431a2aae6..c6dbb976c 100644
--- a/content/en/functions/collections/IsSet.md
+++ b/content/en/functions/collections/IsSet.md
@@ -3,13 +3,14 @@ title: collections.IsSet
description: Reports whether the key exists within the collection.
categories: []
keywords: []
-action:
- aliases: [isset]
- related:
- - functions/go-template/if
- - functions/go-template/with
- returnType: bool
- signatures: [collections.IsSet COLLECTION KEY]
+params:
+ functions_and_methods:
+ aliases: [isset]
+ related:
+ - functions/go-template/if
+ - functions/go-template/with
+ returnType: bool
+ signatures: [collections.IsSet COLLECTION KEY]
aliases: [/functions/isset]
---
diff --git a/content/en/functions/collections/KeyVals.md b/content/en/functions/collections/KeyVals.md
index 6a2109e78..f9d73910d 100644
--- a/content/en/functions/collections/KeyVals.md
+++ b/content/en/functions/collections/KeyVals.md
@@ -3,12 +3,13 @@ title: collections.KeyVals
description: Returns a KeyVals struct.
categories: []
keywords: []
-action:
- aliases: [keyVals]
- related:
- - methods/pages/Related
- returnType: types.KeyValues
- signatures: [collections.KeyVals KEY VALUE...]
+params:
+ functions_and_methods:
+ aliases: [keyVals]
+ related:
+ - methods/pages/Related
+ returnType: types.KeyValues
+ signatures: [collections.KeyVals KEY VALUE...]
aliases: [/functions/keyvals]
---
@@ -16,7 +17,7 @@ The primary application for this function is the definition of the `namedSlices`
[`Related`]: /methods/pages/related/
-See [related content](/content-management/related).
+See [related content](/content-management/related-content/).
```go-html-template
{{ $kv := keyVals "foo" "a" "b" "c" }}
diff --git a/content/en/functions/collections/Last.md b/content/en/functions/collections/Last.md
index 7739b8726..624bbf868 100644
--- a/content/en/functions/collections/Last.md
+++ b/content/en/functions/collections/Last.md
@@ -3,13 +3,14 @@ title: collections.Last
description: Returns the given collection, limited to the last N elements.
categories: []
keywords: []
-action:
- aliases: [last]
- related:
- - functions/collections/After
- - functions/collections/First
- returnType: any
- signatures: [collections.Last N COLLECTION]
+params:
+ functions_and_methods:
+ aliases: [last]
+ related:
+ - functions/collections/After
+ - functions/collections/First
+ returnType: any
+ signatures: [collections.Last N COLLECTION]
aliases: [/functions/last]
---
@@ -22,7 +23,7 @@ aliases: [/functions/last]
Set `N` to zero to return an empty collection.
```go-html-template
-{{ $emptyPageCollection := last 0 .Pages}}
+{{ $emptyPageCollection := last 0 .Pages }}
```
Use `last` and [`where`] together.
diff --git a/content/en/functions/collections/Merge.md b/content/en/functions/collections/Merge.md
index 7cc788f85..b2c4e37c5 100644
--- a/content/en/functions/collections/Merge.md
+++ b/content/en/functions/collections/Merge.md
@@ -3,12 +3,13 @@ title: collections.Merge
description: Returns the result of merging two or more maps.
categories: []
keywords: []
-action:
- aliases: [merge]
- related:
- - functions/collections/Append
- returnType: any
- signatures: [collections.Merge MAP MAP...]
+params:
+ functions_and_methods:
+ aliases: [merge]
+ related:
+ - functions/collections/Append
+ returnType: any
+ signatures: [collections.Merge MAP MAP...]
aliases: [/functions/merge]
---
diff --git a/content/en/functions/collections/NewScratch.md b/content/en/functions/collections/NewScratch.md
index a76168961..053b7158b 100644
--- a/content/en/functions/collections/NewScratch.md
+++ b/content/en/functions/collections/NewScratch.md
@@ -3,23 +3,23 @@ title: collections.NewScratch
description: Returns a locally scoped "scratch pad" to store and manipulate data.
categories: []
keywords: []
-action:
- aliases: [newScratch]
- related:
- - methods/page/Store
- - methods/site/Store
- - methods/shortcode/Store
- - functions/hugo/Store
- returnType: maps.Scratch
+params:
+ functions_and_methods:
+ aliases: [newScratch]
+ related:
+ - methods/page/Store
+ - methods/site/Store
+ - methods/shortcode/Store
+ - functions/hugo/Store
+ returnType: maps.Scratch
signatures: [collections.NewScratch ]
-toc: true
---
Use the `collections.NewScratch` function to create a locally scoped [scratch pad](g) to store and manipulate data. To create a scratch pad with a different [scope](g), refer to the [scope](#scope) section below.
## Methods
-###### Set
+### Set
Sets the value of the given key.
@@ -28,7 +28,7 @@ Sets the value of the given key.
{{ $s.Set "greeting" "Hello" }}
```
-###### Get
+### Get
Gets the value of the given key.
@@ -38,7 +38,7 @@ Gets the value of the given key.
{{ $s.Get "greeting" }} → Hello
```
-###### Add
+### Add
Adds the given value to existing value(s) of the given key.
@@ -65,7 +65,7 @@ For single values, `Add` accepts values that support Go's `+` operator. If the f
{{ $s.Get "greetings" }} → [Hello Welcome Cheers]
```
-###### SetInMap
+### SetInMap
Takes a `key`, `mapKey` and `value` and adds a map of `mapKey` and `value` to the given `key`.
@@ -76,7 +76,7 @@ Takes a `key`, `mapKey` and `value` and adds a map of `mapKey` and `value` to th
{{ $s.Get "greetings" }} → map[english:Hello french:Bonjour]
```
-###### DeleteInMap
+### DeleteInMap
Takes a `key` and `mapKey` and removes the map of `mapKey` from the given `key`.
@@ -88,7 +88,7 @@ Takes a `key` and `mapKey` and removes the map of `mapKey` from the given `key`.
{{ $s.Get "greetings" }} → map[french:Bonjour]
```
-###### GetSortedMapValues
+### GetSortedMapValues
Returns an array of values from `key` sorted by `mapKey`.
@@ -99,7 +99,7 @@ Returns an array of values from `key` sorted by `mapKey`.
{{ $s.GetSortedMapValues "greetings" }} → [Hello Bonjour]
```
-###### Delete
+### Delete
Removes the given key.
@@ -109,9 +109,9 @@ Removes the given key.
{{ $s.Delete "greeting" }}
```
-###### Values
+### Values
-Returns the raw backing map. Do not use with `Scratch` or `Store` methods on a `Page` object due to concurrency issues.
+Returns the raw backing map. Do not use with `Store` methods on a `Page` object due to concurrency issues.
```go-html-template
{{ $s := newScratch }}
diff --git a/content/en/functions/collections/Querify.md b/content/en/functions/collections/Querify.md
index 0eb409421..92979285f 100644
--- a/content/en/functions/collections/Querify.md
+++ b/content/en/functions/collections/Querify.md
@@ -3,13 +3,13 @@ title: collections.Querify
description: Returns a URL query string composed of the given key-value pairs, encoded and sorted by key.
categories: []
keywords: []
-action:
- aliases: [querify]
- related:
- - functions/go-template/urlquery.md
- returnType: string
- signatures:
- - collections.Querify [VALUE...]
+params:
+ functions_and_methods:
+ aliases: [querify]
+ related:
+ - functions/go-template/urlquery.md
+ returnType: string
+ signatures: ['collections.Querify [VALUE...]']
aliases: [/functions/querify]
---
diff --git a/content/en/functions/collections/Reverse.md b/content/en/functions/collections/Reverse.md
index d0a449763..a8914a3d0 100644
--- a/content/en/functions/collections/Reverse.md
+++ b/content/en/functions/collections/Reverse.md
@@ -3,14 +3,15 @@ title: collections.Reverse
description: Reverses the order of a collection.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/collections/Sort
- - functions/collections/Shuffle
- - functions/collections/Uniq
- returnType: any
- signatures: [collections.Reverse COLLECTION]
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/collections/Sort
+ - functions/collections/Shuffle
+ - functions/collections/Uniq
+ returnType: any
+ signatures: [collections.Reverse COLLECTION]
aliases: [/functions/collections.reverse]
---
diff --git a/content/en/functions/collections/Seq.md b/content/en/functions/collections/Seq.md
index b9f66e8d7..efae0b5fd 100644
--- a/content/en/functions/collections/Seq.md
+++ b/content/en/functions/collections/Seq.md
@@ -3,14 +3,15 @@ title: collections.Seq
description: Returns a slice of integers.
categories: []
keywords: []
-action:
- aliases: [seq]
- related: []
- returnType: '[]int'
- signatures:
- - collections.Seq LAST
- - collections.Seq FIRST LAST
- - collections.Seq FIRST INCREMENT LAST
+params:
+ functions_and_methods:
+ aliases: [seq]
+ related: []
+ returnType: '[]int'
+ signatures:
+ - collections.Seq LAST
+ - collections.Seq FIRST LAST
+ - collections.Seq FIRST INCREMENT LAST
aliases: [/functions/seq]
---
diff --git a/content/en/functions/collections/Shuffle.md b/content/en/functions/collections/Shuffle.md
index 0f28eb4d8..ca85334b2 100644
--- a/content/en/functions/collections/Shuffle.md
+++ b/content/en/functions/collections/Shuffle.md
@@ -3,14 +3,15 @@ title: collections.Shuffle
description: Returns a random permutation of a given array or slice.
categories: []
keywords: []
-action:
- aliases: [shuffle]
- related:
- - functions/collections/Reverse
- - functions/collections/Sort
- - functions/collections/Uniq
- returnType: any
- signatures: [collections.Shuffle COLLECTION]
+params:
+ functions_and_methods:
+ aliases: [shuffle]
+ related:
+ - functions/collections/Reverse
+ - functions/collections/Sort
+ - functions/collections/Uniq
+ returnType: any
+ signatures: [collections.Shuffle COLLECTION]
aliases: [/functions/shuffle]
---
diff --git a/content/en/functions/collections/Slice.md b/content/en/functions/collections/Slice.md
index 385f9b658..750763ed9 100644
--- a/content/en/functions/collections/Slice.md
+++ b/content/en/functions/collections/Slice.md
@@ -3,12 +3,13 @@ title: collections.Slice
description: Returns a slice composed of the given values.
categories: []
keywords: []
-action:
- aliases: [slice]
- related:
- - functions/collections/Dictionary
- returnType: any
- signatures: ['collections.Slice [VALUE...]']
+params:
+ functions_and_methods:
+ aliases: [slice]
+ related:
+ - functions/collections/Dictionary
+ returnType: any
+ signatures: ['collections.Slice [VALUE...]']
aliases: [/functions/slice]
---
diff --git a/content/en/functions/collections/Sort.md b/content/en/functions/collections/Sort.md
index ae8f30609..ba0d5814e 100644
--- a/content/en/functions/collections/Sort.md
+++ b/content/en/functions/collections/Sort.md
@@ -3,15 +3,15 @@ title: collections.Sort
description: Sorts slices, maps, and page collections.
categories: []
keywords: []
-action:
- aliases: [sort]
- related:
- - functions/collections/Reverse
- - functions/collections/Shuffle
- - functions/collections/Uniq
- returnType: any
- signatures: ['collections.Sort COLLECTION [KEY] [ORDER]']
-toc: true
+params:
+ functions_and_methods:
+ aliases: [sort]
+ related:
+ - functions/collections/Reverse
+ - functions/collections/Shuffle
+ - functions/collections/Uniq
+ returnType: any
+ signatures: ['collections.Sort COLLECTION [KEY] [ORDER]']
aliases: [/functions/sort]
---
diff --git a/content/en/functions/collections/SymDiff.md b/content/en/functions/collections/SymDiff.md
index 7eba3ef42..d1d4adb2b 100644
--- a/content/en/functions/collections/SymDiff.md
+++ b/content/en/functions/collections/SymDiff.md
@@ -3,15 +3,16 @@ title: collections.SymDiff
description: Returns the symmetric difference of two collections.
categories: []
keywords: []
-action:
- aliases: [symdiff]
- related:
- - functions/collections/Complement
- - functions/collections/Intersect
- - functions/collections/SymDiff
- - functions/collections/Union
- returnType: any
- signatures: [COLLECTION | collections.SymDiff COLLECTION]
+params:
+ functions_and_methods:
+ aliases: [symdiff]
+ related:
+ - functions/collections/Complement
+ - functions/collections/Intersect
+ - functions/collections/SymDiff
+ - functions/collections/Union
+ returnType: any
+ signatures: [COLLECTION | collections.SymDiff COLLECTION]
aliases: [/functions/symdiff]
---
diff --git a/content/en/functions/collections/Union.md b/content/en/functions/collections/Union.md
index 7fed49a10..cb0457d6e 100644
--- a/content/en/functions/collections/Union.md
+++ b/content/en/functions/collections/Union.md
@@ -3,32 +3,29 @@ title: collections.Union
description: Given two arrays or slices, returns a new array that contains the elements that belong to either or both arrays/slices.
categories: []
keywords: []
-action:
- aliases: [union]
- related:
- - functions/collections/Complement
- - functions/collections/Intersect
- - functions/collections/SymDiff
- - functions/collections/Union
- returnType: any
- signatures: [collections.Union SET1 SET2]
+params:
+ functions_and_methods:
+ aliases: [union]
+ related:
+ - functions/collections/Complement
+ - functions/collections/Intersect
+ - functions/collections/SymDiff
+ - functions/collections/Union
+ returnType: any
+ signatures: [collections.Union SET1 SET2]
aliases: [/functions/union]
---
Given two arrays (or slices) A and B, this function will return a new array that contains the elements or objects that belong to either A or to B or to both.
```go-html-template
-{{ union (slice 1 2 3) (slice 3 4 5) }}
-
+{{ union (slice 1 2 3) (slice 3 4 5) }} → [1 2 3 4 5]
-{{ union (slice 1 2 3) nil }}
-
+{{ union (slice 1 2 3) nil }} → [1 2 3]
-{{ union nil (slice 1 2 3) }}
-
+{{ union nil (slice 1 2 3) }} → [1 2 3]
-{{ union nil nil }}
-
+{{ union nil nil }} → []
```
## OR filter in where query
diff --git a/content/en/functions/collections/Uniq.md b/content/en/functions/collections/Uniq.md
index 02b590c18..6fd3c23d7 100644
--- a/content/en/functions/collections/Uniq.md
+++ b/content/en/functions/collections/Uniq.md
@@ -3,15 +3,16 @@ title: collections.Uniq
description: Returns the given collection, removing duplicate elements.
categories: []
keywords: []
-action:
- aliases: [uniq]
- related:
- - functions/collections/Reverse
- - functions/collections/Shuffle
- - functions/collections/Sort
- - functions/collections/Uniq
- returnType: any
- signatures: [collections.Uniq COLLECTION]
+params:
+ functions_and_methods:
+ aliases: [uniq]
+ related:
+ - functions/collections/Reverse
+ - functions/collections/Shuffle
+ - functions/collections/Sort
+ - functions/collections/Uniq
+ returnType: any
+ signatures: [collections.Uniq COLLECTION]
aliases: [/functions/uniq]
---
diff --git a/content/en/functions/collections/Where.md b/content/en/functions/collections/Where.md
index ea02d3ef2..0c03d01a6 100644
--- a/content/en/functions/collections/Where.md
+++ b/content/en/functions/collections/Where.md
@@ -3,12 +3,12 @@ title: collections.Where
description: Returns the given collection, removing elements that do not satisfy the comparison condition.
categories: []
keywords: []
-action:
- aliases: [where]
- related: []
- returnType: any
- signatures: ['collections.Where COLLECTION KEY [OPERATOR] VALUE']
-toc: true
+params:
+ functions_and_methods:
+ aliases: [where]
+ related: []
+ returnType: any
+ signatures: ['collections.Where COLLECTION KEY [OPERATOR] VALUE']
aliases: [/functions/where]
---
@@ -176,7 +176,7 @@ To return a collection of pages where the "author" page parameter begins with ei
{{ $pages := where .Site.RegularPages "Params.author" "like" `(?i)^victor` }}
```
-{{% include "functions/_common/regular-expressions.md" %}}
+{{% include "/_common/functions/regular-expressions.md" %}}
{{< note >}}
Use the `like` operator to compare string values. Comparing other data types will result in an empty collection.
@@ -281,11 +281,10 @@ Useful for theme authors, avoid hardcoding section names by using the `where` fu
With this construct, a theme author can instruct users to specify their main sections in the site configuration:
{{< code-toggle file=hugo >}}
-[params]
mainSections = ['blog','galleries']
{{< /code-toggle >}}
-If `params.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 the site configuration, the `MainSections` method returns a slice with one element---the top-level section with the most pages.
## Boolean/undefined comparison
@@ -393,7 +392,7 @@ This template:
```go-html-template
{{ $p1 := where .Site.RegularPages "Params.exclude" "ne" true }}
-{{ $p2 := where .Site.RegularPages "Params.exclude" "eq" nil }}
+{{ $p2 := where .Site.RegularPages "Params.exclude" "eq" nil }}
{{ range $p1 | complement $p2 }}
- {{ .LinkTitle }}
@@ -413,7 +412,7 @@ This template:
```go-html-template
{{ $p1 := where .Site.RegularPages "Params.exclude" "ne" false }}
-{{ $p2 := where .Site.RegularPages "Params.exclude" "eq" nil }}
+{{ $p2 := where .Site.RegularPages "Params.exclude" "eq" nil }}
{{ range $p1 | complement $p2 }}
- {{ .LinkTitle }}
diff --git a/content/en/functions/collections/_index.md b/content/en/functions/collections/_index.md
index 51981f79b..c7b856f4f 100644
--- a/content/en/functions/collections/_index.md
+++ b/content/en/functions/collections/_index.md
@@ -1,12 +1,7 @@
---
title: Collections functions
linkTitle: collections
-description: Template functions to work with arrays, slices, maps, and page collections.
+description: Use these functions to work with arrays, slices, maps, and page collections.
categories: []
keywords: []
-menu:
- docs:
- parent: functions
---
-
-Use these functions to work with arrays, slices, maps, and page collections.
diff --git a/content/en/functions/compare/Conditional.md b/content/en/functions/compare/Conditional.md
index 997b71e94..ad20f94aa 100644
--- a/content/en/functions/compare/Conditional.md
+++ b/content/en/functions/compare/Conditional.md
@@ -3,12 +3,13 @@ title: compare.Conditional
description: Returns one of two arguments depending on the value of the control argument.
categories: []
keywords: []
-action:
- aliases: [cond]
- related:
- - functions/compare/Default
- returnType: any
- signatures: [compare.Conditional CONTROL ARG1 ARG2]
+params:
+ functions_and_methods:
+ aliases: [cond]
+ related:
+ - functions/compare/Default
+ returnType: any
+ signatures: [compare.Conditional CONTROL ARG1 ARG2]
aliases: [/functions/cond]
---
diff --git a/content/en/functions/compare/Default.md b/content/en/functions/compare/Default.md
index ab52367ec..0f9eb5b62 100644
--- a/content/en/functions/compare/Default.md
+++ b/content/en/functions/compare/Default.md
@@ -2,13 +2,14 @@
title: compare.Default
description: Returns the second argument if set, else the first argument.
keywords: []
-action:
- aliases: [default]
- related:
- - functions/compare/Conditional
- - functions/go-template/Or
- returnType: any
- signatures: [compare.Default DEFAULT INPUT]
+params:
+ functions_and_methods:
+ aliases: [default]
+ related:
+ - functions/compare/Conditional
+ - functions/go-template/Or
+ returnType: any
+ signatures: [compare.Default DEFAULT INPUT]
aliases: [/functions/default]
---
@@ -17,7 +18,7 @@ The `default` function returns the second argument if set, else the first argume
{{< note >}}
When the second argument is the boolean `false` value, the `default` function returns `false`. All _other_ falsy values are considered unset.
-{{% include "functions/go-template/_common/truthy-falsy.md" %}}
+{{% include "/_common/functions/truthy-falsy.md" %}}
To set a default value based on truthiness, use the [`or`] operator instead.
diff --git a/content/en/functions/compare/Eq.md b/content/en/functions/compare/Eq.md
index a877aeddf..b57168ed0 100644
--- a/content/en/functions/compare/Eq.md
+++ b/content/en/functions/compare/Eq.md
@@ -3,16 +3,17 @@ title: compare.Eq
description: Returns the boolean truth of arg1 == arg2 || arg1 == arg3.
categories: []
keywords: []
-action:
- aliases: [eq]
- related:
- - functions/compare/Ge
- - functions/compare/Gt
- - functions/compare/Le
- - functions/compare/Lt
- - functions/compare/Ne
- returnType: bool
- signatures: ['compare.Eq ARG1 ARG2 [ARG...]']
+params:
+ functions_and_methods:
+ aliases: [eq]
+ related:
+ - functions/compare/Ge
+ - functions/compare/Gt
+ - functions/compare/Le
+ - functions/compare/Lt
+ - functions/compare/Ne
+ returnType: bool
+ signatures: ['compare.Eq ARG1 ARG2 [ARG...]']
aliases: [/functions/eq]
---
diff --git a/content/en/functions/compare/Ge.md b/content/en/functions/compare/Ge.md
index ce1fd2302..4fe5c6bff 100644
--- a/content/en/functions/compare/Ge.md
+++ b/content/en/functions/compare/Ge.md
@@ -3,16 +3,17 @@ title: compare.Ge
description: Returns the boolean truth of arg1 >= arg2 && arg1 >= arg3.
categories: []
keywords: []
-action:
- aliases: [ge]
- related:
- - functions/compare/Eq
- - functions/compare/Gt
- - functions/compare/Le
- - functions/compare/Lt
- - functions/compare/Ne
- returnType: bool
- signatures: ['compare.Ge ARG1 ARG2 [ARG...]']
+params:
+ functions_and_methods:
+ aliases: [ge]
+ related:
+ - functions/compare/Eq
+ - functions/compare/Gt
+ - functions/compare/Le
+ - functions/compare/Lt
+ - functions/compare/Ne
+ returnType: bool
+ signatures: ['compare.Ge ARG1 ARG2 [ARG...]']
aliases: [/functions/ge]
---
diff --git a/content/en/functions/compare/Gt.md b/content/en/functions/compare/Gt.md
index 9ff3b0c89..ecbbe9258 100644
--- a/content/en/functions/compare/Gt.md
+++ b/content/en/functions/compare/Gt.md
@@ -3,16 +3,17 @@ title: compare.Gt
description: Returns the boolean truth of arg1 > arg2 && arg1 > arg3.
categories: []
keywords: []
-action:
- aliases: [gt]
- related:
- - functions/compare/Eq
- - functions/compare/Ge
- - functions/compare/Le
- - functions/compare/Lt
- - functions/compare/Ne
- returnType: bool
- signatures: ['compare.Gt ARG1 ARG2 [ARG...]']
+params:
+ functions_and_methods:
+ aliases: [gt]
+ related:
+ - functions/compare/Eq
+ - functions/compare/Ge
+ - functions/compare/Le
+ - functions/compare/Lt
+ - functions/compare/Ne
+ returnType: bool
+ signatures: ['compare.Gt ARG1 ARG2 [ARG...]']
aliases: [/functions/gt]
---
diff --git a/content/en/functions/compare/Le.md b/content/en/functions/compare/Le.md
index a0fbed29d..d35ec1bed 100644
--- a/content/en/functions/compare/Le.md
+++ b/content/en/functions/compare/Le.md
@@ -3,16 +3,17 @@ title: compare.Le
description: Returns the boolean truth of arg1 <= arg2 && arg1 <= arg3.
categories: []
keywords: []
-action:
- aliases: [le]
- related:
- - functions/compare/Eq
- - functions/compare/Ge
- - functions/compare/Gt
- - functions/compare/Lt
- - functions/compare/Ne
- returnType: bool
- signatures: ['compare.Le ARG1 ARG2 [ARG...]']
+params:
+ functions_and_methods:
+ aliases: [le]
+ related:
+ - functions/compare/Eq
+ - functions/compare/Ge
+ - functions/compare/Gt
+ - functions/compare/Lt
+ - functions/compare/Ne
+ returnType: bool
+ signatures: ['compare.Le ARG1 ARG2 [ARG...]']
aliases: [/functions/le]
---
diff --git a/content/en/functions/compare/Lt.md b/content/en/functions/compare/Lt.md
index b306a97b5..51a7b094a 100644
--- a/content/en/functions/compare/Lt.md
+++ b/content/en/functions/compare/Lt.md
@@ -3,16 +3,17 @@ title: compare.Lt
description: Returns the boolean truth of arg1 < arg2 && arg1 < arg3.
categories: []
keywords: []
-action:
- aliases: [lt]
- related:
- - functions/compare/Eq
- - functions/compare/Ge
- - functions/compare/Gt
- - functions/compare/Le
- - functions/compare/Ne
- returnType: bool
- signatures: ['compare.Lt ARG1 ARG2 [ARG...]']
+params:
+ functions_and_methods:
+ aliases: [lt]
+ related:
+ - functions/compare/Eq
+ - functions/compare/Ge
+ - functions/compare/Gt
+ - functions/compare/Le
+ - functions/compare/Ne
+ returnType: bool
+ signatures: ['compare.Lt ARG1 ARG2 [ARG...]']
aliases: [/functions/lt]
---
diff --git a/content/en/functions/compare/Ne.md b/content/en/functions/compare/Ne.md
index dbe0a3898..ce908a766 100644
--- a/content/en/functions/compare/Ne.md
+++ b/content/en/functions/compare/Ne.md
@@ -3,16 +3,17 @@ title: compare.Ne
description: Returns the boolean truth of arg1 != arg2 && arg1 != arg3.
categories: []
keywords: []
-action:
- aliases: [ne]
- related:
- - functions/compare/Eq
- - functions/compare/Ge
- - functions/compare/Gt
- - functions/compare/Le
- - functions/compare/Lt
- returnType: bool
- signatures: ['compare.Ne ARG1 ARG2 [ARG...]']
+params:
+ functions_and_methods:
+ aliases: [ne]
+ related:
+ - functions/compare/Eq
+ - functions/compare/Ge
+ - functions/compare/Gt
+ - functions/compare/Le
+ - functions/compare/Lt
+ returnType: bool
+ signatures: ['compare.Ne ARG1 ARG2 [ARG...]']
aliases: [/functions/ne]
---
diff --git a/content/en/functions/compare/_index.md b/content/en/functions/compare/_index.md
index a9b3a7b27..59673a2c8 100644
--- a/content/en/functions/compare/_index.md
+++ b/content/en/functions/compare/_index.md
@@ -1,12 +1,7 @@
---
title: Compare functions
linkTitle: compare
-description: Template functions to compare two or more values.
+description: Use these functions to compare two or more values.
categories: []
keywords: []
-menu:
- docs:
- parent: functions
---
-
-Use these functions to compare two or more values.
diff --git a/content/en/functions/crypto/FNV32a.md b/content/en/functions/crypto/FNV32a.md
index 3c13346c5..76c3c3e39 100644
--- a/content/en/functions/crypto/FNV32a.md
+++ b/content/en/functions/crypto/FNV32a.md
@@ -1,13 +1,14 @@
---
title: crypto.FNV32a
-description: Returns the 32-bit FNV (Fowler–Noll–Vo) non-cryptographic hash of the given string.
+description: Returns the 32-bit FNV (Fowler-Noll-Vo) non-cryptographic hash of the given string.
categories: []
keywords: []
-action:
- aliases: []
- related: []
- returnType: int
- signatures: [crypto.FNV32a STRING]
+params:
+ functions_and_methods:
+ aliases: []
+ related: []
+ returnType: int
+ signatures: [crypto.FNV32a STRING]
expiryDate: 2026-07-31 # deprecated 2024-07-31 in v0.129.0
---
diff --git a/content/en/functions/crypto/HMAC.md b/content/en/functions/crypto/HMAC.md
index 1906689a2..13df44f1a 100644
--- a/content/en/functions/crypto/HMAC.md
+++ b/content/en/functions/crypto/HMAC.md
@@ -3,15 +3,16 @@ title: crypto.HMAC
description: Returns a cryptographic hash that uses a key to sign a message.
categories: []
keywords: []
-action:
- aliases: [hmac]
- related:
- - functions/crypto/FNV32a
- - functions/crypto/MD5
- - functions/crypto/SHA1
- - functions/crypto/SHA256
- returnType: string
- signatures: ['crypto.HMAC HASH_TYPE KEY MESSAGE [ENCODING]']
+params:
+ functions_and_methods:
+ aliases: [hmac]
+ related:
+ - functions/crypto/FNV32a
+ - functions/crypto/MD5
+ - functions/crypto/SHA1
+ - functions/crypto/SHA256
+ returnType: string
+ signatures: ['crypto.HMAC HASH_TYPE KEY MESSAGE [ENCODING]']
aliases: [/functions/hmac]
---
diff --git a/content/en/functions/crypto/MD5.md b/content/en/functions/crypto/MD5.md
index ba44660df..7eac2607d 100644
--- a/content/en/functions/crypto/MD5.md
+++ b/content/en/functions/crypto/MD5.md
@@ -3,15 +3,16 @@ title: crypto.MD5
description: Hashes the given input and returns its MD5 checksum encoded to a hexadecimal string.
categories: []
keywords: []
-action:
- aliases: [md5]
- related:
- - functions/crypto/FNV32a
- - functions/crypto/HMAC
- - functions/crypto/SHA1
- - functions/crypto/SHA256
- returnType: string
- signatures: [crypto.MD5 INPUT]
+params:
+ functions_and_methods:
+ aliases: [md5]
+ related:
+ - functions/crypto/FNV32a
+ - functions/crypto/HMAC
+ - functions/crypto/SHA1
+ - functions/crypto/SHA256
+ returnType: string
+ signatures: [crypto.MD5 INPUT]
aliases: [/functions/md5]
---
diff --git a/content/en/functions/crypto/SHA1.md b/content/en/functions/crypto/SHA1.md
index 204ff0384..9784e3140 100644
--- a/content/en/functions/crypto/SHA1.md
+++ b/content/en/functions/crypto/SHA1.md
@@ -3,15 +3,16 @@ title: crypto.SHA1
description: Hashes the given input and returns its SHA1 checksum encoded to a hexadecimal string.
categories: []
keywords: []
-action:
- aliases: [sha1]
- related:
- - functions/crypto/FNV32a
- - functions/crypto/HMAC
- - functions/crypto/MD5
- - functions/crypto/SHA256
- returnType: string
- signatures: [crypto.SHA1 INPUT]
+params:
+ functions_and_methods:
+ aliases: [sha1]
+ related:
+ - functions/crypto/FNV32a
+ - functions/crypto/HMAC
+ - functions/crypto/MD5
+ - functions/crypto/SHA256
+ returnType: string
+ signatures: [crypto.SHA1 INPUT]
aliases: [/functions/sha,/functions/sha1]
---
diff --git a/content/en/functions/crypto/SHA256.md b/content/en/functions/crypto/SHA256.md
index 6fb657767..3157a09fe 100644
--- a/content/en/functions/crypto/SHA256.md
+++ b/content/en/functions/crypto/SHA256.md
@@ -3,15 +3,16 @@ title: crypto.SHA256
description: Hashes the given input and returns its SHA256 checksum encoded to a hexadecimal string.
categories: []
keywords: []
-action:
- aliases: [sha256]
- related:
- - functions/crypto/FNV32a
- - functions/crypto/HMAC
- - functions/crypto/MD5
- - functions/crypto/SHA1
- returnType: string
- signatures: [crypto.SHA256 INPUT]
+params:
+ functions_and_methods:
+ aliases: [sha256]
+ related:
+ - functions/crypto/FNV32a
+ - functions/crypto/HMAC
+ - functions/crypto/MD5
+ - functions/crypto/SHA1
+ returnType: string
+ signatures: [crypto.SHA256 INPUT]
aliases: [/functions/sha256]
---
diff --git a/content/en/functions/crypto/_index.md b/content/en/functions/crypto/_index.md
index 5c95aab6e..5771630d4 100644
--- a/content/en/functions/crypto/_index.md
+++ b/content/en/functions/crypto/_index.md
@@ -1,12 +1,7 @@
---
title: Crypto functions
linkTitle: crypto
-description: Template functions to create cryptographic hashes.
+description: Use these functions to create cryptographic hashes.
categories: []
keywords: []
-menu:
- docs:
- parent: functions
---
-
-Use these functions to create cryptographic hashes.
diff --git a/content/en/functions/css/PostCSS.md b/content/en/functions/css/PostCSS.md
index 9b806c2a9..aa8e520d1 100644
--- a/content/en/functions/css/PostCSS.md
+++ b/content/en/functions/css/PostCSS.md
@@ -3,14 +3,14 @@ title: css.PostCSS
description: Processes the given resource with PostCSS using any PostCSS plugin.
categories: []
keywords: []
-action:
- aliases: [postCSS]
- related:
- - functions/css/Sass
- - functions/css/TailwindCSS
- returnType: resource.Resource
- signatures: ['css.PostCSS [OPTIONS] RESOURCE']
-toc: true
+params:
+ functions_and_methods:
+ aliases: [postCSS]
+ related:
+ - functions/css/Sass
+ - functions/css/TailwindCSS
+ returnType: resource.Resource
+ signatures: ['css.PostCSS [OPTIONS] RESOURCE']
---
{{< new-in 0.128.0 />}}
@@ -27,20 +27,23 @@ Follow the steps below to transform CSS using any of the available [PostCSS plug
[postcss plugins]: https://postcss.org/docs/postcss-plugins
-Step 1
-: Install [Node.js].
+### Step 1
+
+Install [Node.js].
[node.js]: https://nodejs.org/en/download
-Step 2
-: Install the required Node.js packages in the root of your project. For example, to add vendor prefixes to your CSS rules:
+### Step 2
+
+Install the required Node.js packages in the root of your project. For example, to add vendor prefixes to your CSS rules:
```sh
npm i -D postcss postcss-cli autoprefixer
```
-Step 3
-: Create a PostCSS configuration file in the root of your project.
+### Step 3
+
+Create a PostCSS configuration file in the root of your project.
{{< code file=postcss.config.js >}}
module.exports = {
@@ -51,14 +54,16 @@ module.exports = {
{{< /code >}}
{{< note >}}
-{{% include "functions/resources/_common/postcss-windows-warning.md" %}}
+{{% include "/_common/functions/postcss-windows-warning.md" %}}
{{< /note >}}
-Step 4
-: Place your CSS file within the `assets/css` directory.
+### Step 4
-Step 5
-: Process the resource with PostCSS:
+Place your CSS file within the `assets/css` directory.
+
+### Step 5
+
+Process the resource with PostCSS:
```go-html-template
{{ with resources.Get "css/main.css" | postCSS }}
@@ -74,13 +79,13 @@ config
: (`string`) The directory that contains the PostCSS configuration file. Default is the root of the project directory.
noMap
-: (`bool`) Default is `false`. If `true`, disables inline sourcemaps.
+: (`bool`) Whether to disable inline source maps. Default is `false`.
inlineImports
-: (`bool`) Default is `false`. Enable inlining of @import statements. It does so recursively, but will only import a file once. URL imports (e.g. `@import url('https://fonts.googleapis.com/css?family=Open+Sans&display=swap');`) and imports with media queries will be ignored. Note that this import routine does not care about the CSS spec, so you can have @import anywhere in the file. Hugo will look for imports relative to the module mount and will respect theme overrides.
+: (`bool`) Whether to enable inlining of import statements. It does so recursively, but will only import a file once. URL imports (e.g. `@import url('https://fonts.googleapis.com/css?family=Open+Sans&display=swap');`) and imports with media queries will be ignored. Note that this import routine does not care about the CSS spec, so you can have @import anywhere in the file. Hugo will look for imports relative to the module mount and will respect theme overrides. Default is `false`.
skipInlineImportsNotFound
-: (`bool`) Default is `false`. Before Hugo 0.99.0 when `inlineImports` was enabled and we failed to resolve an import, we logged it as a warning. We now fail the build. If you have regular CSS imports in your CSS that you want to preserve, you can either use imports with URL or media queries (Hugo does not try to resolve those) or set `skipInlineImportsNotFound` to true.
+: (`bool`) Whether to allow the build process to continue despite unresolved import statements, preserving the original import declarations. If you have regular CSS imports in your CSS that you want to preserve, you can either use imports with URL or media queries (Hugo does not try to resolve those) or set this option to `true`. Default is `false`."
```go-html-template
{{ $opts := dict "config" "config-directory" "noMap" true }}
diff --git a/content/en/functions/css/Sass.md b/content/en/functions/css/Sass.md
index 73f7af1ea..8fe205d3e 100644
--- a/content/en/functions/css/Sass.md
+++ b/content/en/functions/css/Sass.md
@@ -3,16 +3,16 @@ title: css.Sass
description: Transpiles Sass to CSS.
categories: []
keywords: []
-action:
- aliases: [toCSS]
- related:
- - functions/resources/Fingerprint
- - functions/resources/Minify
- - functions/css/PostCSS
- - functions/resources/PostProcess
- returnType: resource.Resource
- signatures: ['css.Sass [OPTIONS] RESOURCE']
-toc: true
+params:
+ functions_and_methods:
+ aliases: [toCSS]
+ related:
+ - functions/resources/Fingerprint
+ - functions/resources/Minify
+ - functions/css/PostCSS
+ - functions/resources/PostProcess
+ returnType: resource.Resource
+ signatures: ['css.Sass [OPTIONS] RESOURCE']
---
{{< new-in 0.128.0 />}}
@@ -70,10 +70,10 @@ precision
: (`int`) Precision of floating point math. Not applicable to Dart Sass.
enableSourceMap
-: (`bool`) If `true`, generates a source map.
+: (`bool`) Whether to generate a source map. Default is `false`.
sourceMapIncludeSources
-: (`bool`) If `true`, embeds sources in the generated source map. Not applicable to LibSass.
+: (`bool`) Whether to embed sources in the generated source map. Not applicable to LibSass. Default is `false`.
includePaths
: (`slice`) A slice of paths, relative to the project root, that the transpiler will use when resolving `@use` and `@import` statements.
@@ -149,8 +149,8 @@ To install Dart Sass for your builds on GitLab Pages, the `.gitlab-ci.yml` file
```yaml
variables:
- HUGO_VERSION: 0.141.0
- DART_SASS_VERSION: 1.83.4
+ HUGO_VERSION: 0.144.2
+ DART_SASS_VERSION: 1.85.0
GIT_DEPTH: 0
GIT_STRATEGY: clone
GIT_SUBMODULE_STRATEGY: recursive
@@ -183,8 +183,8 @@ To install Dart Sass for your builds on Netlify, the `netlify.toml` file should
```toml
[build.environment]
-HUGO_VERSION = "0.141.0"
-DART_SASS_VERSION = "1.83.4"
+HUGO_VERSION = "0.144.2"
+DART_SASS_VERSION = "1.85.0"
NODE_VERSION = "22"
TZ = "America/Los_Angeles"
@@ -234,7 +234,7 @@ If you build Hugo from source and run `mage test -v`, the test will fail if you
[libsass]: https://sass-lang.com/libsass
[prebuilt binaries]: https://github.com/sass/dart-sass/releases/latest
[scoop.sh]: https://scoop.sh/#/apps?q=sass
-[site configuration]: /getting-started/configuration/#configure-build
+[site configuration]: /configuration/build/
[snap package]: /installation/linux/#snap
[snapcraft.io]: https://snapcraft.io/dart-sass
[starter workflow]: https://github.com/actions/starter-workflows/blob/main/pages/hugo.yml
diff --git a/content/en/functions/css/TailwindCSS.md b/content/en/functions/css/TailwindCSS.md
index 44c549196..1657a87df 100644
--- a/content/en/functions/css/TailwindCSS.md
+++ b/content/en/functions/css/TailwindCSS.md
@@ -3,20 +3,20 @@ title: css.TailwindCSS
description: Processes the given resource with the Tailwind CSS CLI.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/resources/Fingerprint
- - functions/resources/Minify
- - functions/css/PostCSS
- returnType: resource.Resource
- signatures: ['css.TailwindCSS [OPTIONS] RESOURCE']
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/resources/Fingerprint
+ - functions/resources/Minify
+ - functions/css/PostCSS
+ returnType: resource.Resource
+ signatures: ['css.TailwindCSS [OPTIONS] RESOURCE']
---
{{< new-in 0.128.0 />}}
-Use the `css.TailwindCSS` function to process your Tailwind CSS files. This function uses the Tailwind CSS CLI to:
+Use the `css.TailwindCSS` function to process your Tailwind CSS files. This function uses the Tailwind CSS CLI to:
1. Scan your templates for Tailwind CSS utility class usage.
1. Compile those utility classes into standard CSS.
@@ -24,7 +24,7 @@ Use the `css.TailwindCSS` function to process your Tailwind CSS files. This fun
## Setup
-###### Step 1
+### Step 1
Install the Tailwind CSS CLI v4.0 or later:
@@ -36,7 +36,7 @@ The TailwindCSS CLI is also available as a [standalone executable] if you want t
[standalone executable]: https://github.com/tailwindlabs/tailwindcss/releases/latest
-###### Step 2
+### Step 2
Add this to your site configuration:
@@ -58,8 +58,7 @@ source = "(postcss|tailwind)\\.config\\.js"
target = "css"
{{< /code-toggle >}}
-
-###### Step 3
+### Step 3
Create a CSS entry file:
@@ -70,7 +69,7 @@ Create a CSS entry file:
Tailwind CSS respects `.gitignore` files. This means that if `hugo_stats.json` is listed in your `.gitignore` file, Tailwind CSS will ignore it. To make `hugo_stats.json` available to Tailwind CSS you must explicitly source it as shown in the example above.
-###### Step 4
+### Step 4
Create a partial template to process the CSS with the Tailwind CSS CLI:
@@ -94,7 +93,7 @@ Create a partial template to process the CSS with the Tailwind CSS CLI:
{{ end }}
{{< /code >}}
-###### Step 5
+### Step 5
Call the partial template from your base template:
@@ -106,7 +105,7 @@ Call the partial template from your base template:
{{< /code >}}
-###### Step 6
+### Step 6
Optionally create a `tailwind.config.js` file in the root of your project as shown below. This is necessary if you use the [Tailwind CSS IntelliSense
extension] for Visual Studio Code.
@@ -137,4 +136,4 @@ inlineImports
: (`bool`) Whether to enable inlining of `@import` statements. Inlining is performed recursively, but currently once only per file. It is not possible to import the same file in different scopes (root, media query, etc.). Note that this import routine does not care about the CSS specification, so you can have `@import` statements anywhere in the file. Default is `false`.
skipInlineImportsNotFound
-: (`bool`) When `inlineImports` is enabled, we fail the build if an import cannot be resolved. Enable this option to allow the build to continue and leave the import statement in place. Note that the inline importer does not process URL location or imports with media queries, so those will be left as-is even without enabling this option. Default is `false`.
+: (`bool`) Whether to allow the build process to continue despite unresolved import statements, preserving the original import declarations. It is important to note that the inline importer does not process URL-based imports or those with media queries, and these will remain unaltered even when this option is disabled. Default is `false`.
diff --git a/content/en/functions/css/_index.md b/content/en/functions/css/_index.md
index a83a23819..9faabbbe9 100644
--- a/content/en/functions/css/_index.md
+++ b/content/en/functions/css/_index.md
@@ -1,12 +1,7 @@
---
title: CSS functions
linkTitle: css
-description: Template functions to work with CSS and Sass files.
+description: Use these functions to work with CSS and Sass files.
categories: []
keywords: []
-menu:
- docs:
- parent: functions
---
-
-Use these functions to work with CSS and Sass files.
diff --git a/content/en/functions/data/GetCSV.md b/content/en/functions/data/GetCSV.md
index 40e6de7e1..305021639 100644
--- a/content/en/functions/data/GetCSV.md
+++ b/content/en/functions/data/GetCSV.md
@@ -3,12 +3,12 @@ title: data.GetCSV
description: Returns an array of arrays from a local or remote CSV file, or an error if the file does not exist.
categories: []
keywords: []
-action:
- aliases: [getCSV]
- related: []
- returnType: '[][]string'
- signatures: ['data.GetCSV SEPARATOR INPUT... [OPTIONS]']
-toc: true
+params:
+ functions_and_methods:
+ aliases: [getCSV]
+ related: []
+ returnType: '[][]string'
+ signatures: ['data.GetCSV SEPARATOR INPUT... [OPTIONS]']
expiryDate: 2026-02-19 # deprecated 2024-02-19 in v0.123.0
---
diff --git a/content/en/functions/data/GetJSON.md b/content/en/functions/data/GetJSON.md
index 58334174b..1965fdc6e 100644
--- a/content/en/functions/data/GetJSON.md
+++ b/content/en/functions/data/GetJSON.md
@@ -3,12 +3,12 @@ title: data.GetJSON
description: Returns a JSON object from a local or remote JSON file, or an error if the file does not exist.
categories: []
keywords: []
-action:
- aliases: [getJSON]
- related: []
- returnType: any
- signatures: ['data.GetJSON INPUT... [OPTIONS]']
-toc: true
+params:
+ functions_and_methods:
+ aliases: [getJSON]
+ related: []
+ returnType: any
+ signatures: ['data.GetJSON INPUT... [OPTIONS]']
expiryDate: 2026-02-19 # deprecated 2024-02-19 in v0.123.0
---
diff --git a/content/en/functions/data/_index.md b/content/en/functions/data/_index.md
index 142d6b528..2177bc528 100644
--- a/content/en/functions/data/_index.md
+++ b/content/en/functions/data/_index.md
@@ -1,12 +1,7 @@
---
title: Data functions
linkTitle: data
-description: Template functions to read local or remote data files.
+description: Use these functions to read local or remote data files.
categories: []
keywords: []
-menu:
- docs:
- parent: functions
---
-
-Use these functions to read local or remote data files.
diff --git a/content/en/functions/debug/Dump.md b/content/en/functions/debug/Dump.md
index 20c0ae8a2..4cba6f66d 100644
--- a/content/en/functions/debug/Dump.md
+++ b/content/en/functions/debug/Dump.md
@@ -3,11 +3,12 @@ title: debug.Dump
description: Returns an object dump as a string.
categories: []
keywords: []
-action:
- aliases: []
- related: []
- returnType: string
- signatures: [debug.Dump VALUE]
+params:
+ functions_and_methods:
+ aliases: []
+ related: []
+ returnType: string
+ signatures: [debug.Dump VALUE]
---
```go-html-template
diff --git a/content/en/functions/debug/Timer.md b/content/en/functions/debug/Timer.md
index 519c195c1..c688ee14a 100644
--- a/content/en/functions/debug/Timer.md
+++ b/content/en/functions/debug/Timer.md
@@ -3,11 +3,12 @@ title: debug.Timer
description: Creates a named timer that reports elapsed time to the console.
categories: []
keywords: []
-action:
- aliases: []
- related: []
- returnType: debug.Timer
- signatures: [debug.Timer NAME]
+params:
+ functions_and_methods:
+ aliases: []
+ related: []
+ returnType: debug.Timer
+ signatures: [debug.Timer NAME]
---
{{< new-in 0.120.0 />}}
diff --git a/content/en/functions/debug/_index.md b/content/en/functions/debug/_index.md
index 418828515..49fe416ed 100644
--- a/content/en/functions/debug/_index.md
+++ b/content/en/functions/debug/_index.md
@@ -1,12 +1,7 @@
---
title: Debug functions
linkTitle: debug
-description: Template functions to debug your templates.
+description: Use these functions to debug your templates.
categories: []
keywords: []
-menu:
- docs:
- parent: functions
---
-
-Use these functions to debug your templates.
diff --git a/content/en/functions/diagrams/Goat.md b/content/en/functions/diagrams/Goat.md
index 69a099bb7..483dcb26f 100644
--- a/content/en/functions/diagrams/Goat.md
+++ b/content/en/functions/diagrams/Goat.md
@@ -3,12 +3,12 @@ title: diagrams.Goat
description: Converts ASCII art to an SVG diagram, returning a GoAT diagram object.
categories: []
keywords: []
-action:
- aliases: []
- related: []
- returnType: diagrams.goatDiagram
- signatures: ['diagrams.Goat INPUT']
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related: []
+ returnType: diagrams.goatDiagram
+ signatures: ['diagrams.Goat INPUT']
---
Useful in a [code block render hook], the `diagram.Goat` function converts ASCII art to an SVG diagram, returning a [GoAT] diagram object with the following methods:
diff --git a/content/en/functions/diagrams/_index.md b/content/en/functions/diagrams/_index.md
index e136b4f33..6aa407071 100644
--- a/content/en/functions/diagrams/_index.md
+++ b/content/en/functions/diagrams/_index.md
@@ -1,12 +1,7 @@
---
title: Diagram functions
linkTitle: diagrams
-description: Template functions to render diagrams.
+description: Use these functions to render diagrams.
categories: []
keywords: []
-menu:
- docs:
- parent: functions
---
-
-Use these functions to render diagrams.
diff --git a/content/en/functions/encoding/Base64Decode.md b/content/en/functions/encoding/Base64Decode.md
index 0745718bb..c7fb75630 100644
--- a/content/en/functions/encoding/Base64Decode.md
+++ b/content/en/functions/encoding/Base64Decode.md
@@ -3,12 +3,13 @@ title: encoding.Base64Decode
description: Returns the base64 decoding of the given content.
categories: []
keywords: []
-action:
- aliases: [base64Decode]
- related:
- - functions/encoding/Base64Encode
- returnType: string
- signatures: [encoding.Base64Decode INPUT]
+params:
+ functions_and_methods:
+ aliases: [base64Decode]
+ related:
+ - functions/encoding/Base64Encode
+ returnType: string
+ signatures: [encoding.Base64Decode INPUT]
aliases: [/functions/base64Decode]
---
@@ -29,7 +30,7 @@ To retrieve and render the content:
{{ with try (resources.GetRemote $url) }}
{{ with .Err }}
{{ errorf "%s" . }}
- {{ else with .Value}}
+ {{ else with .Value }}
{{ with . | transform.Unmarshal }}
{{ .content | base64Decode | markdownify }}
{{ end }}
diff --git a/content/en/functions/encoding/Base64Encode.md b/content/en/functions/encoding/Base64Encode.md
index 14f67a132..576b0732b 100644
--- a/content/en/functions/encoding/Base64Encode.md
+++ b/content/en/functions/encoding/Base64Encode.md
@@ -3,12 +3,13 @@ title: encoding.Base64Encode
description: Returns the base64 decoding of the given content.
categories: []
keywords: []
-action:
- aliases: [base64Encode]
- related:
- - functions/encoding/Base64Decode
- returnType: string
- signatures: [encoding.Base64Encode INPUT]
+params:
+ functions_and_methods:
+ aliases: [base64Encode]
+ related:
+ - functions/encoding/Base64Decode
+ returnType: string
+ signatures: [encoding.Base64Encode INPUT]
aliases: [/functions/base64, /functions/base64Encode]
---
diff --git a/content/en/functions/encoding/Jsonify.md b/content/en/functions/encoding/Jsonify.md
index 475f8a76a..5e799e907 100644
--- a/content/en/functions/encoding/Jsonify.md
+++ b/content/en/functions/encoding/Jsonify.md
@@ -3,14 +3,14 @@ title: encoding.Jsonify
description: Encodes the given object to JSON.
categories: []
keywords: []
-action:
- aliases: [jsonify]
- returnType: template.HTML
- related:
- - functions/transform/Remarshal
- - functions/transform/Unmarshal
- signatures:
- - encoding.Jsonify [OPTIONS] INPUT
+params:
+ functions_and_methods:
+ aliases: [jsonify]
+ returnType: template.HTML
+ related:
+ - functions/transform/Remarshal
+ - functions/transform/Unmarshal
+ signatures: ['encoding.Jsonify [OPTIONS] INPUT']
aliases: [/functions/jsonify]
---
@@ -34,4 +34,4 @@ prefix
: (`string`) Indentation prefix. Default is "".
noHTMLEscape
-: (`bool`) Disable escaping of problematic HTML characters inside JSON quoted strings. The default behavior is to escape `&`, `<`, and `>` to `\u0026`, `\u003c`, and `\u003e` to avoid certain safety problems that can arise when embedding JSON in HTML. Default is `false`.
+: (`bool`) Whether to disable escaping of problematic HTML characters inside JSON quoted strings. The default behavior is to escape `&`, `<`, and `>` to `\u0026`, `\u003c`, and `\u003e` to avoid certain safety problems that can arise when embedding JSON in HTML. Default is `false`.
diff --git a/content/en/functions/encoding/_index.md b/content/en/functions/encoding/_index.md
index 3c4c4519e..f2819f0a7 100644
--- a/content/en/functions/encoding/_index.md
+++ b/content/en/functions/encoding/_index.md
@@ -1,12 +1,7 @@
---
title: Encoding functions
linkTitle: encoding
-description: Template functions to encode and decode data.
+description: Use these functions to encode and decode data.
categories: []
keywords: []
-menu:
- docs:
- parent: functions
---
-
-Use these functions to encode and decode data.
diff --git a/content/en/functions/fmt/Errorf.md b/content/en/functions/fmt/Errorf.md
index 93f546351..8b40c6293 100644
--- a/content/en/functions/fmt/Errorf.md
+++ b/content/en/functions/fmt/Errorf.md
@@ -3,18 +3,19 @@ title: fmt.Errorf
description: Log an ERROR from a template.
categories: []
keywords: []
-action:
- aliases: [errorf]
- related:
- - functions/fmt/Erroridf
- - functions/fmt/Warnf
- - functions/fmt/Warnidf
- returnType: string
- signatures: ['fmt.Errorf FORMAT [INPUT]']
+params:
+ functions_and_methods:
+ aliases: [errorf]
+ related:
+ - functions/fmt/Erroridf
+ - functions/fmt/Warnf
+ - functions/fmt/Warnidf
+ returnType: string
+ signatures: ['fmt.Errorf FORMAT [INPUT]']
aliases: [/functions/errorf]
---
-{{% include "functions/fmt/_common/fmt-layout.md" %}}
+{{% include "/_common/functions/fmt/format-string.md" %}}
The `errorf` function evaluates the format string, then prints the result to the ERROR log and fails the build.
diff --git a/content/en/functions/fmt/Erroridf.md b/content/en/functions/fmt/Erroridf.md
index f442f09bf..bd84b4430 100644
--- a/content/en/functions/fmt/Erroridf.md
+++ b/content/en/functions/fmt/Erroridf.md
@@ -3,18 +3,19 @@ title: fmt.Erroridf
description: Log a suppressible ERROR from a template.
categories: []
keywords: []
-action:
- aliases: [erroridf]
- related:
- - functions/fmt/Errorf
- - functions/fmt/Warnf
- - functions/fmt/Warnidf
- returnType: string
- signatures: ['fmt.Erroridf ID FORMAT [INPUT]']
+params:
+ functions_and_methods:
+ aliases: [erroridf]
+ related:
+ - functions/fmt/Errorf
+ - functions/fmt/Warnf
+ - functions/fmt/Warnidf
+ returnType: string
+ signatures: ['fmt.Erroridf ID FORMAT [INPUT]']
aliases: [/functions/erroridf]
---
-{{% include "functions/fmt/_common/fmt-layout.md" %}}
+{{% 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.
diff --git a/content/en/functions/fmt/Print.md b/content/en/functions/fmt/Print.md
index 6f3128e5f..73b80b51a 100644
--- a/content/en/functions/fmt/Print.md
+++ b/content/en/functions/fmt/Print.md
@@ -3,13 +3,14 @@ title: fmt.Print
description: Prints the default representation of the given arguments using the standard `fmt.Print` function.
categories: []
keywords: []
-action:
- aliases: [print]
- related:
- - functions/fmt/Printf
- - functions/fmt/Println
- returnType: string
- signatures: [fmt.Print INPUT]
+params:
+ functions_and_methods:
+ aliases: [print]
+ related:
+ - functions/fmt/Printf
+ - functions/fmt/Println
+ returnType: string
+ signatures: [fmt.Print INPUT]
aliases: [/functions/print]
---
diff --git a/content/en/functions/fmt/Printf.md b/content/en/functions/fmt/Printf.md
index 5d0127460..cb77f237d 100644
--- a/content/en/functions/fmt/Printf.md
+++ b/content/en/functions/fmt/Printf.md
@@ -3,17 +3,18 @@ title: fmt.Printf
description: Formats a string using the standard `fmt.Sprintf` function.
categories: []
keywords: []
-action:
- aliases: [printf]
- related:
- - functions/fmt/Print
- - functions/fmt/Println
- returnType: string
- signatures: ['fmt.Printf FORMAT [INPUT]']
+params:
+ functions_and_methods:
+ aliases: [printf]
+ related:
+ - functions/fmt/Print
+ - functions/fmt/Println
+ returnType: string
+ signatures: ['fmt.Printf FORMAT [INPUT]']
aliases: [/functions/printf]
---
-{{% include "functions/fmt/_common/fmt-layout.md" %}}
+{{% include "/_common/functions/fmt/format-string.md" %}}
```go-html-template
{{ $var := "world" }}
diff --git a/content/en/functions/fmt/Println.md b/content/en/functions/fmt/Println.md
index a4db56ffb..e4d901bcc 100644
--- a/content/en/functions/fmt/Println.md
+++ b/content/en/functions/fmt/Println.md
@@ -3,13 +3,14 @@ title: fmt.Println
description: Prints the default representation of the given argument using the standard `fmt.Print` function and enforces a line break.
categories: []
keywords: []
-action:
- aliases: [println]
- related:
- - functions/fmt/Print
- - functions/fmt/Printf
- returnType: string
- signatures: [fmt.Println INPUT]
+params:
+ functions_and_methods:
+ aliases: [println]
+ related:
+ - functions/fmt/Print
+ - functions/fmt/Printf
+ returnType: string
+ signatures: [fmt.Println INPUT]
aliases: [/functions/println]
---
diff --git a/content/en/functions/fmt/Warnf.md b/content/en/functions/fmt/Warnf.md
index 643defd30..8b0289e59 100644
--- a/content/en/functions/fmt/Warnf.md
+++ b/content/en/functions/fmt/Warnf.md
@@ -3,18 +3,19 @@ title: fmt.Warnf
description: Log a WARNING from a template.
categories: []
keywords: []
-action:
- aliases: [warnf]
- related:
- - functions/fmt/Errorf
- - functions/fmt/Erroridf
- - functions/fmt/Warnidf
- returnType: string
- signatures: ['fmt.Warnf FORMAT [INPUT]']
+params:
+ functions_and_methods:
+ aliases: [warnf]
+ related:
+ - functions/fmt/Errorf
+ - functions/fmt/Erroridf
+ - functions/fmt/Warnidf
+ returnType: string
+ signatures: ['fmt.Warnf FORMAT [INPUT]']
aliases: [/functions/warnf]
---
-{{% include "functions/fmt/_common/fmt-layout.md" %}}
+{{% include "/_common/functions/fmt/format-string.md" %}}
The `warnf` function evaluates the format string, then prints the result to the WARNING log. Hugo prints each unique message once to avoid flooding the log with duplicate warnings.
diff --git a/content/en/functions/fmt/Warnidf.md b/content/en/functions/fmt/Warnidf.md
index 70c109b5b..33b399386 100644
--- a/content/en/functions/fmt/Warnidf.md
+++ b/content/en/functions/fmt/Warnidf.md
@@ -3,20 +3,21 @@ title: fmt.Warnidf
description: Log a suppressible WARNING from a template.
categories: []
keywords: []
-action:
- aliases: [warnidf]
- related:
- - functions/fmt/Errorf
- - functions/fmt/Erroridf
- - functions/fmt/Warnf
- returnType: string
- signatures: ['fmt.Warnidf ID FORMAT [INPUT]']
+params:
+ functions_and_methods:
+ aliases: [warnidf]
+ related:
+ - functions/fmt/Errorf
+ - functions/fmt/Erroridf
+ - functions/fmt/Warnf
+ returnType: string
+ signatures: ['fmt.Warnidf ID FORMAT [INPUT]']
aliases: [/functions/warnidf]
---
{{< new-in 0.123.0 />}}
-{{% include "functions/fmt/_common/fmt-layout.md" %}}
+{{% include "/_common/functions/fmt/format-string.md" %}}
The `warnidf` function evaluates the format string, then prints the result to the WARNING log. Unlike the [`warnf`] function, you may suppress warnings logged by the `warnidf` function by adding the message ID to the `ignoreLogs` array in your site configuration.
diff --git a/content/en/functions/fmt/_common/_index.md b/content/en/functions/fmt/_common/_index.md
deleted file mode 100644
index 4328d4d14..000000000
--- a/content/en/functions/fmt/_common/_index.md
+++ /dev/null
@@ -1,13 +0,0 @@
----
-cascade:
- _build:
- list: never
- publishResources: false
- render: never
----
-
-
diff --git a/content/en/functions/fmt/_index.md b/content/en/functions/fmt/_index.md
index 51ef847ca..d388df112 100644
--- a/content/en/functions/fmt/_index.md
+++ b/content/en/functions/fmt/_index.md
@@ -1,12 +1,7 @@
---
title: Fmt functions
linkTitle: fmt
-description: Template functions to print strings within a template or to print messages to the terminal
+description: Use these functions to print strings within a template or to print messages to the terminal.
categories: []
keywords: []
-menu:
- docs:
- parent: functions
---
-
-Use these functions to print strings within a template or to print messages to the terminal.
diff --git a/content/en/functions/global/_index.md b/content/en/functions/global/_index.md
index 1e609b56e..3d935176c 100644
--- a/content/en/functions/global/_index.md
+++ b/content/en/functions/global/_index.md
@@ -1,11 +1,6 @@
---
title: Global functions
linkTitle: global
-description: Global template functions to access page and site data.
+description: Use these global functions to access page and site data.
categories: []
-menu:
- docs:
- parent: functions
---
-
-Use these global functions to access page and site data.
diff --git a/content/en/functions/global/page.md b/content/en/functions/global/page.md
index 0ebb3a7d8..43488538b 100644
--- a/content/en/functions/global/page.md
+++ b/content/en/functions/global/page.md
@@ -3,13 +3,13 @@ title: page
description: Provides global access to a Page object.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/global/site
- returnType:
- signatures: [page]
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/global/site
+ returnType:
+ signatures: [page]
aliases: [/functions/page]
---
@@ -33,7 +33,7 @@ Do not use the global `page` function in shortcodes, partials called by shortcod
## Explanation
-Hugo almost always passes a `Page` as the data context into the top level template (e.g., `single.html`). The one exception is the multihost sitemap template. This means that you can access the current page with the `.` in the template.
+Hugo almost always passes a `Page` as the data context into the top-level template (e.g., `single.html`). The one exception is the multihost sitemap template. This means that you can access the current page with the `.` in the template.
But when you are deeply nested inside of a [content view](g), [partial](g), or [render hook](g), it is not always practical or possible to access the `Page` object.
diff --git a/content/en/functions/global/site.md b/content/en/functions/global/site.md
index fd29bd6de..eea85d060 100644
--- a/content/en/functions/global/site.md
+++ b/content/en/functions/global/site.md
@@ -3,12 +3,13 @@ title: site
description: Provides global access to the current Site object.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/global/page
- returnType:
- signatures: [site]
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/global/page
+ returnType:
+ signatures: [site]
aliases: [/functions/site]
---
diff --git a/content/en/functions/go-template/_common/_index.md b/content/en/functions/go-template/_common/_index.md
deleted file mode 100644
index 4328d4d14..000000000
--- a/content/en/functions/go-template/_common/_index.md
+++ /dev/null
@@ -1,13 +0,0 @@
----
-cascade:
- _build:
- list: never
- publishResources: false
- render: never
----
-
-
diff --git a/content/en/functions/go-template/_index.md b/content/en/functions/go-template/_index.md
index 9075756aa..627dc2849 100644
--- a/content/en/functions/go-template/_index.md
+++ b/content/en/functions/go-template/_index.md
@@ -1,14 +1,7 @@
---
title: Go template functions, operators, and statements
linkTitle: go template
-description: Template functions, operators, and statements provided by Go's text/template package.
+description: These are the functions, operators, and statements provided by Go's text/template package.
categories: []
keywords: []
-menu:
- docs:
- parent: functions
---
-
-These are the functions, operators, and statements provided by Go's [text/template] package.
-
-[text/template]: https://pkg.go.dev/text/template
diff --git a/content/en/functions/go-template/and.md b/content/en/functions/go-template/and.md
index 6bc8c60a5..4d8129e18 100644
--- a/content/en/functions/go-template/and.md
+++ b/content/en/functions/go-template/and.md
@@ -3,16 +3,17 @@ title: and
description: Returns the first falsy argument. If all arguments are truthy, returns the last argument.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/go-template/not
- - functions/go-template/or
- returnType: any
- signatures: [and VALUE...]
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/go-template/not
+ - functions/go-template/or
+ returnType: any
+ signatures: [and VALUE...]
---
-{{% include "functions/go-template/_common/truthy-falsy.md" %}}
+{{% include "/_common/functions/truthy-falsy.md" %}}
```go-html-template
{{ and 1 0 "" }} → 0 (int)
@@ -22,5 +23,3 @@ action:
{{ and "a" "b" "c" }} → c (string)
{{ and "a" 1 true }} → true (bool)
```
-
-{{% include "functions/go-template/_common/text-template.md" %}}
diff --git a/content/en/functions/go-template/block.md b/content/en/functions/go-template/block.md
index f8a082037..b71e3d562 100644
--- a/content/en/functions/go-template/block.md
+++ b/content/en/functions/go-template/block.md
@@ -3,13 +3,14 @@ title: block
description: Defines a template and executes it in place.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/go-template/define
- - functions/go-template/end
- returnType:
- signatures: [block NAME CONTEXT]
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/go-template/define
+ - functions/go-template/end
+ returnType:
+ signatures: [block NAME CONTEXT]
---
A block is shorthand for defining a template:
@@ -52,4 +53,4 @@ The typical use is to define a set of root templates that are then customized by
{{ end }}
{{< /code >}}
-{{% include "functions/go-template/_common/text-template.md" %}}
+{{% include "/_common/functions/go-template/text-template.md" %}}
diff --git a/content/en/functions/go-template/break.md b/content/en/functions/go-template/break.md
index 14074d7c0..9744acf7b 100644
--- a/content/en/functions/go-template/break.md
+++ b/content/en/functions/go-template/break.md
@@ -3,13 +3,14 @@ title: break
description: Used with the range statement, stops the innermost iteration and bypasses all remaining iterations.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/go-template/continue
- - functions/go-template/range
- returnType:
- signatures: [break]
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/go-template/continue
+ - functions/go-template/range
+ returnType:
+ signatures: [break]
---
This template code:
@@ -30,4 +31,4 @@ Is rendered to:
foo
```
-{{% include "functions/go-template/_common/text-template.md" %}}
+{{% include "/_common/functions/go-template/text-template.md" %}}
diff --git a/content/en/functions/go-template/continue.md b/content/en/functions/go-template/continue.md
index c8030b8b7..7d9f40591 100644
--- a/content/en/functions/go-template/continue.md
+++ b/content/en/functions/go-template/continue.md
@@ -3,13 +3,14 @@ title: continue
description: Used with the range statement, stops the innermost iteration and continues to the next iteration.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/go-template/break
- - functions/go-template/range
- returnType:
- signatures: [continue]
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/go-template/break
+ - functions/go-template/range
+ returnType:
+ signatures: [continue]
---
This template code:
@@ -31,4 +32,4 @@ Is rendered to:
baz
```
-{{% include "functions/go-template/_common/text-template.md" %}}
+{{% include "/_common/functions/go-template/text-template.md" %}}
diff --git a/content/en/functions/go-template/define.md b/content/en/functions/go-template/define.md
index f15dd6ff0..c2e98c2f2 100644
--- a/content/en/functions/go-template/define.md
+++ b/content/en/functions/go-template/define.md
@@ -3,16 +3,17 @@ title: define
description: Defines a template.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/go-template/block
- - functions/go-template/end
- - functions/go-template/template
- - functions/partials/Include
- - functions/partials/IncludeCached
- returnType:
- signatures: [define NAME]
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/go-template/block
+ - functions/go-template/end
+ - functions/go-template/template
+ - functions/partials/Include
+ - functions/partials/IncludeCached
+ returnType:
+ signatures: [define NAME]
---
Use with the [`block`] statement:
@@ -52,4 +53,4 @@ Use with the [`template`] function:
[`template`]: /functions/go-template/block/
[`partial`]: /functions/partials/include/
-{{% include "functions/go-template/_common/text-template.md" %}}
+{{% include "/_common/functions/go-template/text-template.md" %}}
diff --git a/content/en/functions/go-template/else.md b/content/en/functions/go-template/else.md
index 698998bd8..7d0067010 100644
--- a/content/en/functions/go-template/else.md
+++ b/content/en/functions/go-template/else.md
@@ -3,15 +3,16 @@ title: else
description: Begins an alternate block for if, with, and range statements.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/go-template/if
- - functions/go-template/range
- - functions/go-template/with
- - functions/go-template/end
- returnType:
- signatures: [else VALUE]
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/go-template/if
+ - functions/go-template/range
+ - functions/go-template/with
+ - functions/go-template/end
+ returnType:
+ signatures: [else VALUE]
---
Use with the [`if`] statement:
@@ -62,7 +63,7 @@ Use `else if` to check multiple conditions.
{{ end }}
```
-{{% include "functions/go-template/_common/text-template.md" %}}
+{{% include "/_common/functions/go-template/text-template.md" %}}
[`if`]: /functions/go-template/if/
[`with`]: /functions/go-template/with/
diff --git a/content/en/functions/go-template/end.md b/content/en/functions/go-template/end.md
index 6fb5bbfd6..92b4ec2e4 100644
--- a/content/en/functions/go-template/end.md
+++ b/content/en/functions/go-template/end.md
@@ -3,14 +3,15 @@ title: end
description: Terminates if, with, range, block, and define statements.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/go-template/block
- - functions/go-template/define
- - functions/go-template/if
- - functions/go-template/range
- - functions/go-template/with
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/go-template/block
+ - functions/go-template/define
+ - functions/go-template/if
+ - functions/go-template/range
+ - functions/go-template/with
returnType:
signatures: [end]
---
@@ -56,7 +57,7 @@ Use with the [`define`] statement:
{{ end }}
```
-{{% include "functions/go-template/_common/text-template.md" %}}
+{{% include "/_common/functions/go-template/text-template.md" %}}
[`block`]: /functions/go-template/block/
[`define`]: /functions/go-template/define/
diff --git a/content/en/functions/go-template/if.md b/content/en/functions/go-template/if.md
index 9fdf80e99..969356e1b 100644
--- a/content/en/functions/go-template/if.md
+++ b/content/en/functions/go-template/if.md
@@ -3,18 +3,19 @@ title: if
description: Executes the block if the expression is truthy.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/go-template/with
- - functions/go-template/else
- - functions/go-template/end
- - functions/collections/IsSet
- returnType:
- signatures: [if EXPR]
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/go-template/with
+ - functions/go-template/else
+ - functions/go-template/end
+ - functions/collections/IsSet
+ returnType:
+ signatures: [if EXPR]
---
-{{% include "functions/go-template/_common/truthy-falsy.md" %}}
+{{% include "/_common/functions/truthy-falsy.md" %}}
```go-html-template
{{ $var := "foo" }}
@@ -49,6 +50,6 @@ Use `else if` to check multiple conditions:
{{ end }}
```
-{{% include "functions/go-template/_common/text-template.md" %}}
+{{% include "/_common/functions/go-template/text-template.md" %}}
[`else`]: /functions/go-template/else/
diff --git a/content/en/functions/go-template/len.md b/content/en/functions/go-template/len.md
index 43f150a5f..c717889cb 100644
--- a/content/en/functions/go-template/len.md
+++ b/content/en/functions/go-template/len.md
@@ -3,15 +3,16 @@ title: len
description: Returns the length of a string, slice, map, or collection.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/strings/Count
- - functions/strings/CountRunes
- - functions/strings/CountWords
- - functions/strings/RuneCount
- returnType: int
- signatures: [len VALUE]
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/strings/Count
+ - functions/strings/CountRunes
+ - functions/strings/CountWords
+ - functions/strings/RuneCount
+ returnType: int
+ signatures: [len VALUE]
aliases: [/functions/len]
---
@@ -48,4 +49,4 @@ You may also determine the number of pages in a collection with:
{{ site.RegularPages.Len }} → 42
```
-{{% include "functions/go-template/_common/text-template.md" %}}
+{{% include "/_common/functions/go-template/text-template.md" %}}
diff --git a/content/en/functions/go-template/not.md b/content/en/functions/go-template/not.md
index 4c7747c7b..6f3340f00 100644
--- a/content/en/functions/go-template/not.md
+++ b/content/en/functions/go-template/not.md
@@ -3,13 +3,14 @@ title: not
description: Returns the boolean negation of its single argument.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/go-template/and
- - functions/go-template/or
- returnType: bool
- signatures: [not VALUE]
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/go-template/and
+ - functions/go-template/or
+ returnType: bool
+ signatures: [not VALUE]
---
Unlike the `and` and `or` operators, the `not` operator always returns a boolean value.
@@ -32,4 +33,4 @@ Use the `not` operator, twice in succession, to cast any value to a boolean valu
{{ "" | not | not }} → false
```
-{{% include "functions/go-template/_common/text-template.md" %}}
+{{% include "/_common/functions/go-template/text-template.md" %}}
diff --git a/content/en/functions/go-template/or.md b/content/en/functions/go-template/or.md
index 0d8619608..4ae6ea2c6 100644
--- a/content/en/functions/go-template/or.md
+++ b/content/en/functions/go-template/or.md
@@ -3,16 +3,17 @@ title: or
description: Returns the first truthy argument. If all arguments are falsy, returns the last argument.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/go-template/and
- - functions/go-template/not
- returnType: any
- signatures: [or VALUE...]
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/go-template/and
+ - functions/go-template/not
+ returnType: any
+ signatures: [or VALUE...]
---
-{{% include "functions/go-template/_common/truthy-falsy.md" %}}
+{{% include "/_common/functions/truthy-falsy.md" %}}
```go-html-template
{{ or 0 1 2 }} → 1
@@ -23,4 +24,4 @@ action:
{{ or 0 "" false }} → false
```
-{{% include "functions/go-template/_common/text-template.md" %}}
+{{% include "/_common/functions/go-template/text-template.md" %}}
diff --git a/content/en/functions/go-template/range.md b/content/en/functions/go-template/range.md
index 94f654a55..099d31305 100644
--- a/content/en/functions/go-template/range.md
+++ b/content/en/functions/go-template/range.md
@@ -3,20 +3,20 @@ title: range
description: Iterates over a non-empty collection, binds context (the dot) to successive elements, and executes the block.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/go-template/break
- - functions/go-template/continue
- - functions/go-template/else
- - functions/go-template/end
- returnType:
- signatures: [range COLLECTION]
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/go-template/break
+ - functions/go-template/continue
+ - functions/go-template/else
+ - functions/go-template/end
+ returnType:
+ signatures: [range COLLECTION]
aliases: [/functions/range]
-toc: true
---
-{{% include "functions/go-template/_common/truthy-falsy.md" %}}
+{{% include "/_common/functions/truthy-falsy.md" %}}
```go-html-template
{{ $s := slice "foo" "bar" "baz" }}
@@ -191,7 +191,7 @@ Is rendered to:
Unlike ranging over an array or slice, Hugo sorts by key when ranging over a map.
-{{% include "functions/go-template/_common/text-template.md" %}}
+{{% include "/_common/functions/go-template/text-template.md" %}}
[`else`]: /functions/go-template/else/
[`break`]: /functions/go-template/break/
diff --git a/content/en/functions/go-template/return.md b/content/en/functions/go-template/return.md
index 9b40889e1..a7f2287d4 100644
--- a/content/en/functions/go-template/return.md
+++ b/content/en/functions/go-template/return.md
@@ -3,14 +3,14 @@ title: return
description: Used within partial templates, terminates template execution and returns the given value, if any.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/partials/Include
- - functions/partials/IncludeCached
- returnType: any
- signatures: ['return [VALUE]']
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/partials/Include
+ - functions/partials/IncludeCached
+ returnType: any
+ signatures: ['return [VALUE]']
---
The `return` statement is a non-standard extension to Go's [text/template package]. Used within partial templates, the `return` statement terminates template execution and returns the given value, if any.
diff --git a/content/en/functions/go-template/template.md b/content/en/functions/go-template/template.md
index 0a72acdaa..0edcf5b47 100644
--- a/content/en/functions/go-template/template.md
+++ b/content/en/functions/go-template/template.md
@@ -3,14 +3,15 @@ title: template
description: Executes the given template, optionally passing context.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/go-template/define
- - functions/partials/Include
- - functions/partials/IncludeCached
- returnType:
- signatures: ['template NAME [CONTEXT]']
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/go-template/define
+ - functions/partials/Include
+ - functions/partials/IncludeCached
+ returnType:
+ signatures: ['template NAME [CONTEXT]']
---
Use the `template` function to execute [embedded templates]. For example:
@@ -42,7 +43,7 @@ The example above can be rewritten using an [inline partial] template:
{{ end }}
```
-{{% include "functions/go-template/_common/text-template.md" %}}
+{{% include "/_common/functions/go-template/text-template.md" %}}
[`partial`]: /functions/partials/include/
[inline partial]: /templates/partial/#inline-partials
diff --git a/content/en/functions/go-template/try.md b/content/en/functions/go-template/try.md
index 979c90b61..48364d520 100644
--- a/content/en/functions/go-template/try.md
+++ b/content/en/functions/go-template/try.md
@@ -3,12 +3,12 @@ title: try
description: Returns a TryValue object after evaluating the given expression.
categories: []
keywords: []
-action:
- aliases: []
- related: []
- returnType: TryValue
- signatures: ['try EXPRESSION']
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related: []
+ returnType: TryValue
+ signatures: ['try EXPRESSION']
---
{{< new-in 0.141.0 />}}
@@ -21,11 +21,13 @@ The `try` statement is a non-standard extension to Go's [text/template] package.
The `TryValue` object encapsulates the result of evaluating the expression, and provides two methods:
-Err
-: (`string`) Returns a string representation of the error thrown by the expression, if an error occurred, or returns `nil` if the expression evaluated without errors.
+### Err
-Value
-: (`any`) Returns the result of the expression if the evaluation was successful, or returns `nil` if an error occurred while evaluating the expression.
+(`string`) Returns a string representation of the error thrown by the expression, if an error occurred, or returns `nil` if the expression evaluated without errors.
+
+### Value
+
+(`any`) Returns the result of the expression if the evaluation was successful, or returns `nil` if an error occurred while evaluating the expression.
## Explanation
diff --git a/content/en/functions/go-template/urlquery.md b/content/en/functions/go-template/urlquery.md
index 946828f56..58e63072a 100644
--- a/content/en/functions/go-template/urlquery.md
+++ b/content/en/functions/go-template/urlquery.md
@@ -3,12 +3,13 @@ title: urlquery
description: Returns the escaped value of the textual representation of its arguments in a form suitable for embedding in a URL query.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/collections/Querify
- returnType: string
- signatures: ['urlquery VALUE [VALUE...]']
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/collections/Querify
+ returnType: string
+ signatures: ['urlquery VALUE [VALUE...]']
aliases: [/functions/urlquery]
---
@@ -25,4 +26,4 @@ Is rendered to:
Link
```
-{{% include "functions/go-template/_common/text-template.md" %}}
+{{% include "/_common/functions/go-template/text-template.md" %}}
diff --git a/content/en/functions/go-template/with.md b/content/en/functions/go-template/with.md
index 64f8859bf..0f5e7466b 100644
--- a/content/en/functions/go-template/with.md
+++ b/content/en/functions/go-template/with.md
@@ -3,20 +3,20 @@ title: with
description: Binds context (the dot) to the expression and executes the block if expression is truthy.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/go-template/if
- - functions/go-template/else
- - functions/go-template/end
- - functions/collections/IsSet
- returnType:
- signatures: [with EXPR]
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/go-template/if
+ - functions/go-template/else
+ - functions/go-template/end
+ - functions/collections/IsSet
+ returnType:
+ signatures: [with EXPR]
aliases: [/functions/with]
-toc: true
---
-{{% include "functions/go-template/_common/truthy-falsy.md" %}}
+{{% include "/_common/functions/truthy-falsy.md" %}}
```go-html-template
{{ $var := "foo" }}
@@ -94,6 +94,6 @@ This template will render the page title as desired:
Gaining a thorough understanding of context is critical for anyone writing template code.
{{< /note >}}
-{{% include "functions/go-template/_common/text-template.md" %}}
+{{% include "/_common/functions/go-template/text-template.md" %}}
[`else`]: /functions/go-template/else/
diff --git a/content/en/functions/hash/FNV32a.md b/content/en/functions/hash/FNV32a.md
index b5af77519..701cf576d 100644
--- a/content/en/functions/hash/FNV32a.md
+++ b/content/en/functions/hash/FNV32a.md
@@ -1,18 +1,19 @@
---
title: hash.FNV32a
-description: Returns the 32-bit FNV (Fowler–Noll–Vo) non-cryptographic hash of the given string.
+description: Returns the 32-bit FNV (Fowler-Noll-Vo) non-cryptographic hash of the given string.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/hash/Xxhash
- - functions/crypto/HMAC
- - functions/crypto/MD5
- - functions/crypto/SHA1
- - functions/crypto/SHA256
- returnType: int
- signatures: [hash.FNV32a STRING]
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/hash/Xxhash
+ - functions/crypto/HMAC
+ - functions/crypto/MD5
+ - functions/crypto/SHA1
+ - functions/crypto/SHA256
+ returnType: int
+ signatures: [hash.FNV32a STRING]
aliases: [/functions/crypto.fnv32a]
---
diff --git a/content/en/functions/hash/XxHash.md b/content/en/functions/hash/XxHash.md
index 7d35c18e5..b208697cb 100644
--- a/content/en/functions/hash/XxHash.md
+++ b/content/en/functions/hash/XxHash.md
@@ -3,16 +3,17 @@ title: hash.XxHash
description: Returns the 64-bit xxHash non-cryptographic hash of the given string.
categories: []
keywords: []
-action:
- aliases: [xxhash]
- related:
- - functions/hash/FNV32a
- - functions/crypto/HMAC
- - functions/crypto/MD5
- - functions/crypto/SHA1
- - functions/crypto/SHA256
- returnType: string
- signatures: [hash.XxHash STRING]
+params:
+ functions_and_methods:
+ aliases: [xxhash]
+ related:
+ - functions/hash/FNV32a
+ - functions/crypto/HMAC
+ - functions/crypto/MD5
+ - functions/crypto/SHA1
+ - functions/crypto/SHA256
+ returnType: string
+ signatures: [hash.XxHash STRING]
---
```go-html-template
diff --git a/content/en/functions/hash/_index.md b/content/en/functions/hash/_index.md
index bf21c5b7b..956f7fb8d 100644
--- a/content/en/functions/hash/_index.md
+++ b/content/en/functions/hash/_index.md
@@ -1,12 +1,7 @@
---
title: Hash functions
linkTitle: hash
-description: Template functions to create non-cryptographic hashes.
+description: Use these functions to create non-cryptographic hashes.
categories: []
keywords: []
-menu:
- docs:
- parent: functions
---
-
-Use these functions to create non-cryptographic hashes.
diff --git a/content/en/functions/hugo/BuildDate.md b/content/en/functions/hugo/BuildDate.md
index 1fbdbeac6..1350091f0 100644
--- a/content/en/functions/hugo/BuildDate.md
+++ b/content/en/functions/hugo/BuildDate.md
@@ -3,11 +3,12 @@ title: hugo.BuildDate
description: Returns the compile date of the Hugo binary.
categories: []
keywords: []
-action:
- aliases: []
- related: []
- returnType: string
- signatures: [hugo.BuildDate]
+params:
+ functions_and_methods:
+ aliases: []
+ related: []
+ returnType: string
+ signatures: [hugo.BuildDate]
---
The `hugo.BuildDate` function returns the compile date of the Hugo binary, formatted per [RFC 3339].
diff --git a/content/en/functions/hugo/CommitHash.md b/content/en/functions/hugo/CommitHash.md
index cd4f2ce92..f1f46db92 100644
--- a/content/en/functions/hugo/CommitHash.md
+++ b/content/en/functions/hugo/CommitHash.md
@@ -3,11 +3,12 @@ title: hugo.CommitHash
description: Returns the Git commit hash of the Hugo binary.
categories: []
keywords: []
-action:
- aliases: []
- related: []
- returnType: string
- signatures: [hugo.CommitHash]
+params:
+ functions_and_methods:
+ aliases: []
+ related: []
+ returnType: string
+ signatures: [hugo.CommitHash]
---
```go-html-template
diff --git a/content/en/functions/hugo/Deps.md b/content/en/functions/hugo/Deps.md
index 2f3f75e65..fe5e050b5 100644
--- a/content/en/functions/hugo/Deps.md
+++ b/content/en/functions/hugo/Deps.md
@@ -3,11 +3,12 @@ title: hugo.Deps
description: Returns a slice of project dependencies, either Hugo Modules or local theme components.
categories: []
keywords: []
-action:
- aliases: []
- related: []
- returnType: '[]hugo.Dependency'
- signatures: [hugo.Deps]
+params:
+ functions_and_methods:
+ aliases: []
+ related: []
+ returnType: '[]hugo.Dependency'
+ signatures: [hugo.Deps]
---
The `hugo.Deps` function returns a slice of project dependencies, either Hugo Modules or local theme components. Each dependency contains:
diff --git a/content/en/functions/hugo/Environment.md b/content/en/functions/hugo/Environment.md
index 374a39f6c..d15a18412 100644
--- a/content/en/functions/hugo/Environment.md
+++ b/content/en/functions/hugo/Environment.md
@@ -3,13 +3,14 @@ title: hugo.Environment
description: Returns the current running environment.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/hugo/IsDevelopment
- - functions/hugo/IsProduction
- returnType: string
- signatures: [hugo.Environment]
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/hugo/IsDevelopment
+ - functions/hugo/IsProduction
+ returnType: string
+ signatures: [hugo.Environment]
---
The `hugo.Environment` function returns the current running [environment](g) as defined through the `--environment` command line flag.
diff --git a/content/en/functions/hugo/Generator.md b/content/en/functions/hugo/Generator.md
index 17eb47e1d..c8b4067bc 100644
--- a/content/en/functions/hugo/Generator.md
+++ b/content/en/functions/hugo/Generator.md
@@ -1,15 +1,16 @@
---
title: hugo.Generator
-description: Renders an HTML meta element identifying the software that generated the site.
+description: Renders an HTML meta element identifying the software that generated the site.
categories: []
keywords: []
-action:
- aliases: []
- related: []
- returnType: template.HTML
- signatures: [hugo.Generator]
+params:
+ functions_and_methods:
+ aliases: []
+ related: []
+ returnType: template.HTML
+ signatures: [hugo.Generator]
---
```go-html-template
-{{ hugo.Generator }} →
+{{ hugo.Generator }} →
```
diff --git a/content/en/functions/hugo/GoVersion.md b/content/en/functions/hugo/GoVersion.md
index 34c6266bf..cc66ef098 100644
--- a/content/en/functions/hugo/GoVersion.md
+++ b/content/en/functions/hugo/GoVersion.md
@@ -3,11 +3,12 @@ title: hugo.GoVersion
description: Returns the Go version used to compile the Hugo binary
categories: []
keywords: []
-action:
- aliases: []
- related: []
- returnType: string
- signatures: [hugo.GoVersion]
+params:
+ functions_and_methods:
+ aliases: []
+ related: []
+ returnType: string
+ signatures: [hugo.GoVersion]
---
```go-html-template
diff --git a/content/en/functions/hugo/IsDevelopment.md b/content/en/functions/hugo/IsDevelopment.md
index bfbc0eaa1..690913c76 100644
--- a/content/en/functions/hugo/IsDevelopment.md
+++ b/content/en/functions/hugo/IsDevelopment.md
@@ -3,13 +3,14 @@ title: hugo.IsDevelopment
description: Reports whether the current running environment is "development".
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/hugo/IsProduction
- - functions/hugo/Environment
- returnType: bool
- signatures: [hugo.IsDevelopment]
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/hugo/IsProduction
+ - functions/hugo/Environment
+ returnType: bool
+ signatures: [hugo.IsDevelopment]
---
{{< new-in 0.120.0 />}}
diff --git a/content/en/functions/hugo/IsExtended.md b/content/en/functions/hugo/IsExtended.md
index 9beac6e49..b006ff0e2 100644
--- a/content/en/functions/hugo/IsExtended.md
+++ b/content/en/functions/hugo/IsExtended.md
@@ -3,11 +3,12 @@ title: hugo.IsExtended
description: Reports whether the Hugo binary is either the extended or extended/deploy edition.
categories: []
keywords: []
-action:
- aliases: []
- related: []
- returnType: bool
- signatures: [hugo.IsExtended]
+params:
+ functions_and_methods:
+ aliases: []
+ related: []
+ returnType: bool
+ signatures: [hugo.IsExtended]
---
```go-html-template
diff --git a/content/en/functions/hugo/IsMultihost.md b/content/en/functions/hugo/IsMultihost.md
index 5c1cb9f83..d1df9c67f 100644
--- a/content/en/functions/hugo/IsMultihost.md
+++ b/content/en/functions/hugo/IsMultihost.md
@@ -3,12 +3,13 @@ title: hugo.IsMultihost
description: Reports whether each configured language has a unique base URL.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - /functions/hugo/IsMultilingual
- returnType: bool
- signatures: [hugo.IsMultihost]
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - /functions/hugo/IsMultilingual
+ returnType: bool
+ signatures: [hugo.IsMultihost]
---
{{< new-in 0.124.0 />}}
diff --git a/content/en/functions/hugo/IsMultilingual.md b/content/en/functions/hugo/IsMultilingual.md
index 91beb0d52..4b3c6e766 100644
--- a/content/en/functions/hugo/IsMultilingual.md
+++ b/content/en/functions/hugo/IsMultilingual.md
@@ -3,11 +3,13 @@ title: hugo.IsMultilingual
description: Reports whether there are two or more configured languages.
categories: []
keywords: []
-action:
- related:
- - /functions/hugo/IsMultihost
- returnType: bool
- signatures: [hugo.IsMultilingual]
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - /functions/hugo/IsMultihost
+ returnType: bool
+ signatures: [hugo.IsMultilingual]
---
{{< new-in 0.124.0 />}}
diff --git a/content/en/functions/hugo/IsProduction.md b/content/en/functions/hugo/IsProduction.md
index 7e9bda0e3..2e6fca0d9 100644
--- a/content/en/functions/hugo/IsProduction.md
+++ b/content/en/functions/hugo/IsProduction.md
@@ -3,13 +3,14 @@ title: hugo.IsProduction
description: Reports whether the current running environment is "production".
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/hugo/IsDevelopment
- - functions/hugo/Environment
- returnType: bool
- signatures: [hugo.IsProduction]
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/hugo/IsDevelopment
+ - functions/hugo/Environment
+ returnType: bool
+ signatures: [hugo.IsProduction]
---
```go-html-template
diff --git a/content/en/functions/hugo/IsServer.md b/content/en/functions/hugo/IsServer.md
index 0fa42fc15..5517fc271 100644
--- a/content/en/functions/hugo/IsServer.md
+++ b/content/en/functions/hugo/IsServer.md
@@ -3,11 +3,12 @@ title: hugo.IsServer
description: Reports whether the built-in development server is running.
categories: []
keywords: []
-action:
- aliases: []
- related: []
- returnType: bool
- signatures: [hugo.IsServer]
+params:
+ functions_and_methods:
+ aliases: []
+ related: []
+ returnType: bool
+ signatures: [hugo.IsServer]
---
{{< new-in 0.120.0 />}}
diff --git a/content/en/functions/hugo/Store.md b/content/en/functions/hugo/Store.md
index 4f3250954..5248a0222 100644
--- a/content/en/functions/hugo/Store.md
+++ b/content/en/functions/hugo/Store.md
@@ -3,15 +3,15 @@ title: hugo.Store
description: Returns a globally scoped "scratch pad" to store and manipulate data.
categories: []
keywords: []
-action:
- related:
- - methods/page/Store
- - methods/site/Store
- - methods/shortcode/Store
- - functions/collections/NewScratch
- returnType: maps.Scratch
- signatures: [hugo.Store]
-toc: true
+params:
+ functions_and_methods:
+ related:
+ - methods/page/Store
+ - methods/site/Store
+ - methods/shortcode/Store
+ - functions/collections/NewScratch
+ returnType: maps.Scratch
+ signatures: [hugo.Store]
---
{{< new-in 0.139.0 />}}
@@ -20,7 +20,7 @@ Use the `hugo.Store` function to create a globally scoped [scratch pad](g) to st
## Methods
-###### Set
+### Set
Sets the value of the given key.
@@ -28,7 +28,7 @@ Sets the value of the given key.
{{ hugo.Store.Set "greeting" "Hello" }}
```
-###### Get
+### Get
Gets the value of the given key.
@@ -37,7 +37,7 @@ Gets the value of the given key.
{{ hugo.Store.Get "greeting" }} → Hello
```
-###### Add
+### Add
Adds the given value to the existing value(s) of the given key.
@@ -61,7 +61,7 @@ For single values, `Add` accepts values that support Go's `+` operator. If the f
{{ hugo.Store.Get "greetings" }} → [Hello Welcome Cheers]
```
-###### SetInMap
+### SetInMap
Takes a `key`, `mapKey` and `value` and adds a map of `mapKey` and `value` to the given `key`.
@@ -71,7 +71,7 @@ Takes a `key`, `mapKey` and `value` and adds a map of `mapKey` and `value` to th
{{ hugo.Store.Get "greetings" }} → map[english:Hello french:Bonjour]
```
-###### DeleteInMap
+### DeleteInMap
Takes a `key` and `mapKey` and removes the map of `mapKey` from the given `key`.
@@ -80,9 +80,9 @@ Takes a `key` and `mapKey` and removes the map of `mapKey` from the given `key`.
{{ hugo.Store.SetInMap "greetings" "french" "Bonjour" }}
{{ hugo.Store.DeleteInMap "greetings" "english" }}
{{ hugo.Store.Get "greetings" }} → map[french:Bonjour]
-```
+ ```
-###### GetSortedMapValues
+### GetSortedMapValues
Returns an array of values from `key` sorted by `mapKey`.
@@ -92,7 +92,7 @@ Returns an array of values from `key` sorted by `mapKey`.
{{ hugo.Store.GetSortedMapValues "greetings" }} → [Hello Bonjour]
```
-###### Delete
+### Delete
Removes the given key.
diff --git a/content/en/functions/hugo/Version.md b/content/en/functions/hugo/Version.md
index e6e1207b8..a6afc04cd 100644
--- a/content/en/functions/hugo/Version.md
+++ b/content/en/functions/hugo/Version.md
@@ -3,13 +3,14 @@ title: hugo.Version
description: Returns the current version of the Hugo binary.
categories: []
keywords: []
-action:
- aliases: []
- related: []
- returnType: hugo.VersionString
- signatures: [hugo.Version]
+params:
+ functions_and_methods:
+ aliases: []
+ related: []
+ returnType: hugo.VersionString
+ signatures: [hugo.Version]
---
```go-html-template
-{{ hugo.Version }} → 0.141.0
+{{ hugo.Version }} → 0.144.2
```
diff --git a/content/en/functions/hugo/WorkingDir.md b/content/en/functions/hugo/WorkingDir.md
index ac3835ea8..4e04cfb9b 100644
--- a/content/en/functions/hugo/WorkingDir.md
+++ b/content/en/functions/hugo/WorkingDir.md
@@ -3,11 +3,12 @@ title: hugo.WorkingDir
description: Returns the project working directory.
categories: []
keywords: []
-action:
- aliases: []
- related: []
- returnType: string
- signatures: [hugo.WorkingDir]
+params:
+ functions_and_methods:
+ aliases: []
+ related: []
+ returnType: string
+ signatures: [hugo.WorkingDir]
---
```go-html-template
diff --git a/content/en/functions/hugo/_index.md b/content/en/functions/hugo/_index.md
index c3ad686da..b1c9216c4 100644
--- a/content/en/functions/hugo/_index.md
+++ b/content/en/functions/hugo/_index.md
@@ -1,12 +1,7 @@
---
title: Hugo functions
linkTitle: hugo
-description: Template functions to access information about the Hugo application and the current environment.
+description: Use these functions to access information about the Hugo application and the current environment.
categories: []
keywords: []
-menu:
- docs:
- parent: functions
---
-
-Use these functions to access information about the Hugo application and the current environment.
diff --git a/content/en/functions/images/AutoOrient.md b/content/en/functions/images/AutoOrient.md
index fca9d392e..953f6d5cc 100644
--- a/content/en/functions/images/AutoOrient.md
+++ b/content/en/functions/images/AutoOrient.md
@@ -3,14 +3,14 @@ title: images.AutoOrient
description: Returns an image filter that rotates and flips an image as needed per its EXIF orientation tag.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/images/Filter
- - methods/resource/Filter
- returnType: images.filter
- signatures: [images.AutoOrient]
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/images/Filter
+ - methods/resource/Filter
+ returnType: images.filter
+ signatures: [images.AutoOrient]
---
{{< new-in 0.121.2 />}}
@@ -23,7 +23,8 @@ Create the filter:
{{ $filter := images.AutoOrient }}
```
-{{% include "functions/images/_common/apply-image-filter.md" %}}
+
+{{% include "/_common/functions/images/apply-image-filter.md" %}}
{{< note >}}
When using with other filters, specify `images.AutoOrient` first.
diff --git a/content/en/functions/images/Brightness.md b/content/en/functions/images/Brightness.md
index 0001bcba8..b8e5b62b2 100644
--- a/content/en/functions/images/Brightness.md
+++ b/content/en/functions/images/Brightness.md
@@ -3,14 +3,14 @@ title: images.Brightness
description: Returns an image filter that changes the brightness of an image.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/images/Filter
- - methods/resource/Filter
- returnType: images.filter
- signatures: [images.Brightness PERCENTAGE]
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/images/Filter
+ - methods/resource/Filter
+ returnType: images.filter
+ signatures: [images.Brightness PERCENTAGE]
---
The percentage must be in the range [-100, 100] where 0 has no effect. A value of `-100` produces a solid black image, and a value of `100` produces a solid white image.
@@ -23,7 +23,7 @@ Create the image filter:
{{ $filter := images.Brightness 12 }}
```
-{{% include "functions/images/_common/apply-image-filter.md" %}}
+{{% include "/_common/functions/images/apply-image-filter.md" %}}
## Example
diff --git a/content/en/functions/images/ColorBalance.md b/content/en/functions/images/ColorBalance.md
index 29829f9e6..10654cba4 100644
--- a/content/en/functions/images/ColorBalance.md
+++ b/content/en/functions/images/ColorBalance.md
@@ -3,14 +3,14 @@ title: images.ColorBalance
description: Returns an image filter that changes the color balance of an image.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/images/Filter
- - methods/resource/Filter
- returnType: images.filter
- signatures: [images.ColorBalance PCTRED PCTGREEN PCTBLUE]
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/images/Filter
+ - methods/resource/Filter
+ returnType: images.filter
+ signatures: [images.ColorBalance PCTRED PCTGREEN PCTBLUE]
---
The percentage for each channel (red, green, blue) must be in the range [-100, 500].
@@ -23,7 +23,7 @@ Create the filter:
{{ $filter := images.ColorBalance -10 10 50 }}
```
-{{% include "functions/images/_common/apply-image-filter.md" %}}
+{{% include "/_common/functions/images/apply-image-filter.md" %}}
## Example
diff --git a/content/en/functions/images/Colorize.md b/content/en/functions/images/Colorize.md
index c974103b9..f6e065197 100644
--- a/content/en/functions/images/Colorize.md
+++ b/content/en/functions/images/Colorize.md
@@ -3,14 +3,14 @@ title: images.Colorize
description: Returns an image filter that produces a colorized version of an image.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/images/Filter
- - methods/resource/Filter
- returnType: images.filter
- signatures: [images.Colorize HUE SATURATION PERCENTAGE]
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/images/Filter
+ - methods/resource/Filter
+ returnType: images.filter
+ signatures: [images.Colorize HUE SATURATION PERCENTAGE]
---
The hue is the angle on the color wheel, typically in the range [0, 360].
@@ -27,7 +27,7 @@ Create the filter:
{{ $filter := images.Colorize 180 50 20 }}
```
-{{% include "functions/images/_common/apply-image-filter.md" %}}
+{{% include "/_common/functions/images/apply-image-filter.md" %}}
## Example
diff --git a/content/en/functions/images/Config.md b/content/en/functions/images/Config.md
index 4df088033..f435a247c 100644
--- a/content/en/functions/images/Config.md
+++ b/content/en/functions/images/Config.md
@@ -3,11 +3,12 @@ title: images.Config
description: Returns an image.Config structure from the image at the specified path, relative to the working directory.
categories: []
keywords: []
-action:
- aliases: []
- related: []
- returnType: image.Config
- signatures: [images.Config PATH]
+params:
+ functions_and_methods:
+ aliases: []
+ related: []
+ returnType: image.Config
+ signatures: [images.Config PATH]
aliases: [/functions/imageconfig]
---
diff --git a/content/en/functions/images/Contrast.md b/content/en/functions/images/Contrast.md
index 532ae8c9c..a59d045fe 100644
--- a/content/en/functions/images/Contrast.md
+++ b/content/en/functions/images/Contrast.md
@@ -3,14 +3,14 @@ title: images.Contrast
description: Returns an image filter that changes the contrast of an image.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/images/Filter
- - methods/resource/Filter
- returnType: images.filter
- signatures: [images.Contrast PERCENTAGE]
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/images/Filter
+ - methods/resource/Filter
+ returnType: images.filter
+ signatures: [images.Contrast PERCENTAGE]
---
The percentage must be in the range [-100, 100] where 0 has no effect. A value of `-100` produces a solid grey image, and a value of `100` produces an over-contrasted image.
@@ -23,7 +23,7 @@ Create the filter:
{{ $filter := images.Contrast -20 }}
```
-{{% include "functions/images/_common/apply-image-filter.md" %}}
+{{% include "/_common/functions/images/apply-image-filter.md" %}}
## Example
diff --git a/content/en/functions/images/Dither.md b/content/en/functions/images/Dither.md
index d6ae603a8..9f3106401 100644
--- a/content/en/functions/images/Dither.md
+++ b/content/en/functions/images/Dither.md
@@ -3,16 +3,16 @@ title: images.Dither
description: Returns an image filter that dithers an image.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/images/Filter
- - functions/images/Process
- - methods/resource/Colors
- - methods/resource/Filter
- returnType: images.filter
- signatures: ['images.Dither [OPTIONS]']
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/images/Filter
+ - functions/images/Process
+ - methods/resource/Colors
+ - methods/resource/Filter
+ returnType: images.filter
+ signatures: ['images.Dither [OPTIONS]']
---
{{< new-in 0.123.0 />}}
@@ -28,7 +28,7 @@ method
: (`string`) The dithering method. See the [dithering methods](#dithering-methods) section below for a list of the available methods. Default is `FloydSteinberg`.
serpentine
-: (`bool`) Applicable to error diffusion dithering methods, serpentine controls whether the error diffusion matrix is applied in a serpentine manner, meaning that it goes right-to-left every other line. This greatly reduces line-type artifacts. Default is `true`.
+: (`bool`) Applicable to error diffusion dithering methods, whether to apply the error diffusion matrix in a serpentine manner, meaning that it goes right-to-left every other line. This greatly reduces line-type artifacts. Default is `true`.
strength
: (`float`) The strength at which to apply the dithering matrix, typically a value in the range [0, 1]. A value of `1.0` applies the dithering matrix at 100% strength (no modification of the dither matrix). The `strength` is inversely proportional to contrast; reducing the strength increases the contrast. Setting `strength` to a value such as `0.8` can be useful to reduce noise in the dithered image. Default is `1.0`.
@@ -57,13 +57,13 @@ Or create the filter using the default settings:
{{ $filter := images.Dither }}
```
-{{% include "functions/images/_common/apply-image-filter.md" %}}
+{{% include "/_common/functions/images/apply-image-filter.md" %}}
## Dithering methods
See the [Go documentation] for descriptions of each of the dithering methods below.
-[Go documentation]: https://pkg.go.dev/github.com/makeworld-the-better-one/dither/v2#pkg-variables
+[Go documentation]: https://pkg.go.dev/github.com/makeworld-the-better-one/dither/v2#pkg-variables
Error diffusion dithering methods:
diff --git a/content/en/functions/images/Filter.md b/content/en/functions/images/Filter.md
index 2961d7f47..1701b0928 100644
--- a/content/en/functions/images/Filter.md
+++ b/content/en/functions/images/Filter.md
@@ -3,13 +3,13 @@ title: images.Filter
description: Applies one or more image filters to the given image resource.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - methods/resource/Filter
- returnType: images.ImageResource
- signatures: [images.Filter FILTERS... IMAGE]
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - methods/resource/Filter
+ returnType: images.ImageResource
+ signatures: [images.Filter FILTERS... IMAGE]
---
Apply one or more [image filters](#image-filters) to the given image.
diff --git a/content/en/functions/images/Gamma.md b/content/en/functions/images/Gamma.md
index affbdcfa8..35e0f6dc8 100644
--- a/content/en/functions/images/Gamma.md
+++ b/content/en/functions/images/Gamma.md
@@ -3,14 +3,14 @@ title: images.Gamma
description: Returns an image filter that performs gamma correction on an image.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/images/Filter
- - methods/resource/Filter
- returnType: images.filter
- signatures: [images.Gamma GAMMA]
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/images/Filter
+ - methods/resource/Filter
+ returnType: images.filter
+ signatures: [images.Gamma GAMMA]
---
The gamma value must be positive. A value greater than 1 lightens the image, while a value less than 1 darkens the image. The filter has no effect when the gamma value is 1.
@@ -23,7 +23,7 @@ Create the filter:
{{ $filter := images.Gamma 1.667 }}
```
-{{% include "functions/images/_common/apply-image-filter.md" %}}
+{{% include "/_common/functions/images/apply-image-filter.md" %}}
## Example
diff --git a/content/en/functions/images/GaussianBlur.md b/content/en/functions/images/GaussianBlur.md
index e2f49a847..0340681bc 100644
--- a/content/en/functions/images/GaussianBlur.md
+++ b/content/en/functions/images/GaussianBlur.md
@@ -3,14 +3,14 @@ title: images.GaussianBlur
description: Returns an image filter that applies a gaussian blur to an image.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/images/Filter
- - methods/resource/Filter
- returnType: images.filter
- signatures: [images.GaussianBlur SIGMA]
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/images/Filter
+ - methods/resource/Filter
+ returnType: images.filter
+ signatures: [images.GaussianBlur SIGMA]
---
The sigma value must be positive, and indicates how much the image will be blurred. The blur-affected radius is approximately 3 times the sigma value.
@@ -23,7 +23,7 @@ Create the filter:
{{ $filter := images.GaussianBlur 5 }}
```
-{{% include "functions/images/_common/apply-image-filter.md" %}}
+{{% include "/_common/functions/images/apply-image-filter.md" %}}
## Example
diff --git a/content/en/functions/images/Grayscale.md b/content/en/functions/images/Grayscale.md
index d8a89b7f2..ef1955140 100644
--- a/content/en/functions/images/Grayscale.md
+++ b/content/en/functions/images/Grayscale.md
@@ -3,14 +3,14 @@ title: images.Grayscale
description: Returns an image filter that produces a grayscale version of an image.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/images/Filter
- - methods/resource/Filter
- returnType: images.filter
- signatures: [images.Grayscale]
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/images/Filter
+ - methods/resource/Filter
+ returnType: images.filter
+ signatures: [images.Grayscale]
---
## Usage
@@ -21,7 +21,7 @@ Create the filter:
{{ $filter := images.Grayscale }}
```
-{{% include "functions/images/_common/apply-image-filter.md" %}}
+{{% include "/_common/functions/images/apply-image-filter.md" %}}
## Example
diff --git a/content/en/functions/images/Hue.md b/content/en/functions/images/Hue.md
index 6eafac437..b41b6b0c8 100644
--- a/content/en/functions/images/Hue.md
+++ b/content/en/functions/images/Hue.md
@@ -3,14 +3,14 @@ title: images.Hue
description: Returns an image filter that rotates the hue of an image.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/images/Filter
- - methods/resource/Filter
- returnType: images.filter
- signatures: [images.Hue SHIFT]
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/images/Filter
+ - methods/resource/Filter
+ returnType: images.filter
+ signatures: [images.Hue SHIFT]
---
The hue angle shift is typically in the range [-180, 180] where 0 has no effect.
@@ -23,7 +23,7 @@ Create the filter:
{{ $filter := images.Hue -15 }}
```
-{{% include "functions/images/_common/apply-image-filter.md" %}}
+{{% include "/_common/functions/images/apply-image-filter.md" %}}
## Example
diff --git a/content/en/functions/images/Invert.md b/content/en/functions/images/Invert.md
index 1ee85e514..94def1b41 100644
--- a/content/en/functions/images/Invert.md
+++ b/content/en/functions/images/Invert.md
@@ -3,14 +3,14 @@ title: images.Invert
description: Returns an image filter that negates the colors of an image.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/images/Filter
- - methods/resource/Filter
- returnType: images.filter
- signatures: [images.Invert]
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/images/Filter
+ - methods/resource/Filter
+ returnType: images.filter
+ signatures: [images.Invert]
---
## Usage
@@ -21,7 +21,7 @@ Create the filter:
{{ $filter := images.Invert }}
```
-{{% include "functions/images/_common/apply-image-filter.md" %}}
+{{% include "/_common/functions/images/apply-image-filter.md" %}}
## Example
diff --git a/content/en/functions/images/Mask.md b/content/en/functions/images/Mask.md
index 11fce93b0..a8fb1d680 100644
--- a/content/en/functions/images/Mask.md
+++ b/content/en/functions/images/Mask.md
@@ -3,14 +3,14 @@ title: images.Mask
description: Returns an image filter that applies a mask to the source image.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/images/Filter
- - methods/resource/Filter
- returnType: images.filter
- signatures: [images.Mask RESOURCE]
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/images/Filter
+ - methods/resource/Filter
+ returnType: images.filter
+ signatures: [images.Mask RESOURCE]
---
{{< new-in 0.141.0 />}}
@@ -18,7 +18,7 @@ toc: true
The `images.Mask` filter applies a mask to an image. Black pixels in the mask make the corresponding areas of the base image transparent, while white pixels keep them opaque. Color images are converted to grayscale for masking purposes. The mask is automatically resized to match the dimensions of the base image.
{{< note >}}
-Of the formats supported by Hugo's imaging pipelie, only PNG and WebP have an alpha channel to support transparency. If your source image has a different format and you require transparent masked areas, convert it to either PNG or WebP as shown in the example below.
+Of the formats supported by Hugo's imaging pipeline, only PNG and WebP have an alpha channel to support transparency. If your source image has a different format and you require transparent masked areas, convert it to either PNG or WebP as shown in the example below.
{{< /note >}}
When applying a mask to a non-transparent image format such as JPEG, the masked areas will be filled with the color specified by the `bgColor` parameter in your [site configuration]. You can override that color with a `Process` image filter:
@@ -27,7 +27,7 @@ When applying a mask to a non-transparent image format such as JPEG, the masked
{{ $filter := images.Process "#00ff00" }}
```
-[site configuration]: /content-management/image-processing/#imaging-configuration
+[site configuration]: /configuration/imaging/
## Usage
diff --git a/content/en/functions/images/Opacity.md b/content/en/functions/images/Opacity.md
index 32b1bd23c..00dbf3f15 100644
--- a/content/en/functions/images/Opacity.md
+++ b/content/en/functions/images/Opacity.md
@@ -3,14 +3,14 @@ title: images.Opacity
description: Returns an image filter that changes the opacity of an image.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/images/Filter
- - methods/resource/Filter
- returnType: images.filter
- signatures: [images.Opacity OPACITY]
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/images/Filter
+ - methods/resource/Filter
+ returnType: images.filter
+ signatures: [images.Opacity OPACITY]
---
{{< new-in 0.119.0 />}}
@@ -25,7 +25,7 @@ Create the filter:
{{ $filter := images.Opacity 0.65 }}
```
-{{% include "functions/images/_common/apply-image-filter.md" %}}
+{{% include "/_common/functions/images/apply-image-filter.md" %}}
The `images.Opacity` filter is most useful for target formats such as PNG and WebP that support transparency. If the source image does not support transparency, combine this filter with the `images.Process` filter:
diff --git a/content/en/functions/images/Overlay.md b/content/en/functions/images/Overlay.md
index d1cd7cf3f..ed65ba6ca 100644
--- a/content/en/functions/images/Overlay.md
+++ b/content/en/functions/images/Overlay.md
@@ -3,14 +3,14 @@ title: images.Overlay
description: Returns an image filter that overlays the source image at the given coordinates, relative to the upper left corner.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/images/Filter
- - methods/resource/Filter
- returnType: images.filter
- signatures: [images.Overlay RESOURCE X Y]
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/images/Filter
+ - methods/resource/Filter
+ returnType: images.filter
+ signatures: [images.Overlay RESOURCE X Y]
---
## Usage
@@ -35,7 +35,7 @@ Create the filter:
{{ $filter := images.Overlay $overlay 20 20 }}
```
-{{% include "functions/images/_common/apply-image-filter.md" %}}
+{{% include "/_common/functions/images/apply-image-filter.md" %}}
## Example
diff --git a/content/en/functions/images/Padding.md b/content/en/functions/images/Padding.md
index e2c2695a1..5eb55beba 100644
--- a/content/en/functions/images/Padding.md
+++ b/content/en/functions/images/Padding.md
@@ -3,14 +3,14 @@ title: images.Padding
description: Returns an image filter that resizes the image canvas without resizing the image.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/images/Filter
- - methods/resource/Filter
- returnType: images.filter
- signatures: ['images.Padding V1 [V2] [V3] [V4] [COLOR]']
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/images/Filter
+ - methods/resource/Filter
+ returnType: images.filter
+ signatures: ['images.Padding V1 [V2] [V3] [V4] [COLOR]']
---
{{< new-in 0.120.0 />}}
@@ -28,7 +28,7 @@ Create the filter:
{{ $filter := images.Padding 20 40 "#976941" }}
```
-{{% include "functions/images/_common/apply-image-filter.md" %}}
+{{% include "/_common/functions/images/apply-image-filter.md" %}}
Combine with the [`Colors`] method to create a border with one of the image's most dominant colors:
diff --git a/content/en/functions/images/Pixelate.md b/content/en/functions/images/Pixelate.md
index 2016877ed..a3e98c160 100644
--- a/content/en/functions/images/Pixelate.md
+++ b/content/en/functions/images/Pixelate.md
@@ -3,14 +3,14 @@ title: images.Pixelate
description: Returns an image filter that applies a pixelation effect to an image.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/images/Filter
- - methods/resource/Filter
- returnType: images.filter
- signatures: [images.Pixelate SIZE]
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/images/Filter
+ - methods/resource/Filter
+ returnType: images.filter
+ signatures: [images.Pixelate SIZE]
---
## Usage
@@ -21,7 +21,7 @@ Create the filter:
{{ $filter := images.Pixelate 4 }}
```
-{{% include "functions/images/_common/apply-image-filter.md" %}}
+{{% include "/_common/functions/images/apply-image-filter.md" %}}
## Example
diff --git a/content/en/functions/images/Process.md b/content/en/functions/images/Process.md
index 959770c65..724e23ac2 100644
--- a/content/en/functions/images/Process.md
+++ b/content/en/functions/images/Process.md
@@ -3,15 +3,15 @@ title: images.Process
description: Returns an image filter that processes the given image using the given specification.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/images/Filter
- - methods/resource/Filter
- - methods/resource/Process
- returnType: images.filter
- signatures: [images.Process SPEC]
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/images/Filter
+ - methods/resource/Filter
+ - methods/resource/Process
+ returnType: images.filter
+ signatures: [images.Process SPEC]
---
{{< new-in 0.119.0 />}}
@@ -101,7 +101,7 @@ Create a filter:
{{ $filter := images.Process "resize 256x q40 webp" }}
```
-{{% include "functions/images/_common/apply-image-filter.md" %}}
+{{% include "/_common/functions/images/apply-image-filter.md" %}}
## Example
diff --git a/content/en/functions/images/QR.md b/content/en/functions/images/QR.md
index cbefaefff..6d6a5485a 100644
--- a/content/en/functions/images/QR.md
+++ b/content/en/functions/images/QR.md
@@ -2,13 +2,12 @@
title: images.QR
description: Encodes the given text into a QR code using the specified options, returning an image resource.
keywords: []
-action:
- aliases: []
- related: []
- returnType: images.ImageResource
- signatures: ['images.QR TEXT [OPTIONS]']
-toc: true
-math: true
+params:
+ functions_and_methods:
+ aliases: []
+ related: []
+ returnType: images.ImageResource
+ signatures: ['images.QR TEXT [OPTIONS]']
---
{{< new-in 0.141.0 />}}
@@ -41,7 +40,7 @@ scale
targetDir
: (`string`) The subdirectory within the [`publishDir`] where Hugo will place the generated image. Use Unix-style slashes (`/`) to separarate path segments. If empty or not provided, the image is placed directly in the `publishDir` root. Hugo automatically creates the necessary subdirectories if they don't exist.
-[`publishDir`]: /getting-started/configuration/#publishdir
+[`publishDir`]: /configuration/all/#publishdir
## Examples
diff --git a/content/en/functions/images/Saturation.md b/content/en/functions/images/Saturation.md
index 118bd0213..9fda889b4 100644
--- a/content/en/functions/images/Saturation.md
+++ b/content/en/functions/images/Saturation.md
@@ -3,14 +3,14 @@ title: images.Saturation
description: Returns an image filter that changes the saturation of an image.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/images/Filter
- - methods/resource/Filter
- returnType: images.filter
- signatures: [images.Saturation PERCENTAGE]
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/images/Filter
+ - methods/resource/Filter
+ returnType: images.filter
+ signatures: [images.Saturation PERCENTAGE]
---
The percentage must be in the range [-100, 500] where 0 has no effect.
@@ -23,7 +23,7 @@ Create the filter:
{{ $filter := images.Saturation 65 }}
```
-{{% include "functions/images/_common/apply-image-filter.md" %}}
+{{% include "/_common/functions/images/apply-image-filter.md" %}}
## Example
diff --git a/content/en/functions/images/Sepia.md b/content/en/functions/images/Sepia.md
index 9f0b7adfb..a82ee85ea 100644
--- a/content/en/functions/images/Sepia.md
+++ b/content/en/functions/images/Sepia.md
@@ -3,14 +3,14 @@ title: images.Sepia
description: Returns an image filter that produces a sepia-toned version of an image.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/images/Filter
- - methods/resource/Filter
- returnType: images.filter
- signatures: [images.Sepia PERCENTAGE]
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/images/Filter
+ - methods/resource/Filter
+ returnType: images.filter
+ signatures: [images.Sepia PERCENTAGE]
---
The percentage must be in the range [0, 100] where 0 has no effect.
@@ -23,7 +23,7 @@ Create the filter:
{{ $filter := images.Sepia 75 }}
```
-{{% include "functions/images/_common/apply-image-filter.md" %}}
+{{% include "/_common/functions/images/apply-image-filter.md" %}}
## Example
diff --git a/content/en/functions/images/Sigmoid.md b/content/en/functions/images/Sigmoid.md
index 32765f923..c7ad8016a 100644
--- a/content/en/functions/images/Sigmoid.md
+++ b/content/en/functions/images/Sigmoid.md
@@ -3,14 +3,14 @@ title: images.Sigmoid
description: Returns an image filter that changes the contrast of an image using a sigmoidal function.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/images/Filter
- - methods/resource/Filter
- returnType: images.filter
- signatures: [images.Sigmoid MIDPOINT FACTOR]
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/images/Filter
+ - methods/resource/Filter
+ returnType: images.filter
+ signatures: [images.Sigmoid MIDPOINT FACTOR]
---
This is a non-linear contrast change useful for photo adjustments; it preserves highlight and shadow detail.
@@ -27,7 +27,7 @@ Create the filter:
{{ $filter := images.Sigmoid 0.6 -4 }}
```
-{{% include "functions/images/_common/apply-image-filter.md" %}}
+{{% include "/_common/functions/images/apply-image-filter.md" %}}
## Example
diff --git a/content/en/functions/images/Text.md b/content/en/functions/images/Text.md
index c8d23565c..df86d6ed9 100644
--- a/content/en/functions/images/Text.md
+++ b/content/en/functions/images/Text.md
@@ -3,14 +3,14 @@ title: images.Text
description: Returns an image filter that adds text to an image.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/images/Filter
- - methods/resource/Filter
- returnType: images.filter
- signatures: ['images.Text TEXT [OPTIONS]']
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/images/Filter
+ - methods/resource/Filter
+ returnType: images.filter
+ signatures: ['images.Text TEXT [OPTIONS]']
---
## Options
diff --git a/content/en/functions/images/UnsharpMask.md b/content/en/functions/images/UnsharpMask.md
index 9ea58f2b6..1dd55f2f6 100644
--- a/content/en/functions/images/UnsharpMask.md
+++ b/content/en/functions/images/UnsharpMask.md
@@ -3,14 +3,14 @@ title: images.UnsharpMask
description: Returns an image filter that sharpens an image.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/images/Filter
- - methods/resource/Filter
- returnType: images.filter
- signatures: [images.UnsharpMask SIGMA AMOUNT THRESHOLD]
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/images/Filter
+ - methods/resource/Filter
+ returnType: images.filter
+ signatures: [images.UnsharpMask SIGMA AMOUNT THRESHOLD]
---
The sigma argument is used in a gaussian function and affects the radius of effect. Sigma must be positive. The sharpen radius is approximately 3 times the sigma value.
@@ -27,7 +27,7 @@ Create the filter:
{{ $filter := images.UnsharpMask 10 0.4 0.03 }}
```
-{{% include "functions/images/_common/apply-image-filter.md" %}}
+{{% include "/_common/functions/images/apply-image-filter.md" %}}
## Example
diff --git a/content/en/functions/images/_common/_index.md b/content/en/functions/images/_common/_index.md
deleted file mode 100644
index 4328d4d14..000000000
--- a/content/en/functions/images/_common/_index.md
+++ /dev/null
@@ -1,13 +0,0 @@
----
-cascade:
- _build:
- list: never
- publishResources: false
- render: never
----
-
-
diff --git a/content/en/functions/images/_index.md b/content/en/functions/images/_index.md
index 13542ea73..f92e16e7a 100644
--- a/content/en/functions/images/_index.md
+++ b/content/en/functions/images/_index.md
@@ -4,9 +4,4 @@ linkTitle: images
description: Use these functions to create an image filter, apply an image filter to an image, and to retrieve image information.
categories: []
keywords: []
-menu:
- docs:
- parent: functions
---
-
-Use these functions to create an image filter, apply an image filter to an image, and to retrieve image information.
diff --git a/content/en/functions/inflect/Humanize.md b/content/en/functions/inflect/Humanize.md
index 71b4a5fd2..4e38ddac2 100644
--- a/content/en/functions/inflect/Humanize.md
+++ b/content/en/functions/inflect/Humanize.md
@@ -3,13 +3,14 @@ title: inflect.Humanize
description: Returns the humanized version of the input with the first letter capitalized.
categories: []
keywords: []
-action:
- aliases: [humanize]
- related:
- - functions/inflect/Pluralize
- - functions/inflect/Singularize
- returnType: string
- signatures: [inflect.Humanize INPUT]
+params:
+ functions_and_methods:
+ aliases: [humanize]
+ related:
+ - functions/inflect/Pluralize
+ - functions/inflect/Singularize
+ returnType: string
+ signatures: [inflect.Humanize INPUT]
aliases: [/functions/humanize]
---
diff --git a/content/en/functions/inflect/Pluralize.md b/content/en/functions/inflect/Pluralize.md
index c25f89617..dc1fe7fe8 100644
--- a/content/en/functions/inflect/Pluralize.md
+++ b/content/en/functions/inflect/Pluralize.md
@@ -3,13 +3,14 @@ title: inflect.Pluralize
description: Pluralizes the given word according to a set of common English pluralization rules.
categories: []
keywords: []
-action:
- aliases: [pluralize]
- related:
- - functions/inflect/Humanize
- - functions/inflect/Singularize
- returnType: string
- signatures: [inflect.Pluralize INPUT]
+params:
+ functions_and_methods:
+ aliases: [pluralize]
+ related:
+ - functions/inflect/Humanize
+ - functions/inflect/Singularize
+ returnType: string
+ signatures: [inflect.Pluralize INPUT]
aliases: [/functions/pluralize]
---
diff --git a/content/en/functions/inflect/Singularize.md b/content/en/functions/inflect/Singularize.md
index d2a8572f6..eee5c5002 100644
--- a/content/en/functions/inflect/Singularize.md
+++ b/content/en/functions/inflect/Singularize.md
@@ -3,13 +3,14 @@ title: inflect.Singularize
description: Singularizes the given word according to a set of common English singularization rules.
categories: []
keywords: []
-action:
- aliases: [singularize]
- related:
- - functions/inflect/Humanize
- - functions/inflect/Pluralize
- returnType: string
- signatures: [inflect.Singularize INPUT]
+params:
+ functions_and_methods:
+ aliases: [singularize]
+ related:
+ - functions/inflect/Humanize
+ - functions/inflect/Pluralize
+ returnType: string
+ signatures: [inflect.Singularize INPUT]
aliases: [/functions/singularize]
---
diff --git a/content/en/functions/inflect/_index.md b/content/en/functions/inflect/_index.md
index 601b409e6..2afe4fe33 100644
--- a/content/en/functions/inflect/_index.md
+++ b/content/en/functions/inflect/_index.md
@@ -1,12 +1,7 @@
---
title: Inflect functions
linkTitle: inflect
-description: Template functions to inflect English nouns.
+description: These functions provide word inflection features such as singularization and pluralization of English nouns.
categories: []
keywords: []
-menu:
- docs:
- parent: functions
---
-
-These functions provide word inflection features such as singularization and pluralization of English nouns.
diff --git a/content/en/functions/js/Babel.md b/content/en/functions/js/Babel.md
index 08bce47e5..cd6a5095f 100644
--- a/content/en/functions/js/Babel.md
+++ b/content/en/functions/js/Babel.md
@@ -3,17 +3,16 @@ title: js.Babel
description: Compile the given JavaScript resource with Babel.
categories: []
keywords: []
-action:
- aliases: [babel]
- related:
- - functions/js/Batch
- - functions/js/Build
- - functions/resources/Fingerprint
- - functions/resources/Minify
- returnType: resource.Resource
- signatures: ['js.Babel [OPTIONS] RESOURCE']
-weight: 30
-toc: true
+params:
+ functions_and_methods:
+ aliases: [babel]
+ related:
+ - functions/js/Batch
+ - functions/js/Build
+ - functions/resources/Fingerprint
+ - functions/resources/Minify
+ returnType: resource.Resource
+ signatures: ['js.Babel [OPTIONS] RESOURCE']
---
```go-html-template
@@ -37,18 +36,21 @@ toc: true
## Setup
-Step 1
-: Install [Node.js](https://nodejs.org/en/download)
+### Step 1
-Step 2
-: Install the required Node.js packages in the root of your project.
+Install [Node.js](https://nodejs.org/en/download)
+
+### Step 2
+
+Install the required Node.js packages in the root of your project.
```sh
npm install --save-dev @babel/core @babel/cli
```
-Step 3
-: Add the babel executable to Hugo's `security.exec.allow` list in your site configuration:
+### Step 3
+
+Add the babel executable to Hugo's `security.exec.allow` list in your site configuration:
{{< code-toggle file=hugo >}}
[security.exec]
@@ -75,32 +77,29 @@ module.exports = {
## Options
-###### compact
+compact
+: (`bool`) Whether to remove optional newlines and whitespace. Enabled when `minified` is `true`. Default is `false`
-(`bool`) Whether to remove optional newlines and whitespace. Enabled when `minified` is `true`. Default is `false`
+config
+: (`string`) Path to the Babel configuration file. Hugo will, by default, look for a `babel.config.js` file in the root of your project. See [details](https://babeljs.io/docs/en/configuration).
-###### config
+minified
+: (`bool`) Whether to minify the compiled code. Enables the `compact` option. Default is `false`.
-(`string`) Path to the Babel configuration file. Hugo will, by default, look for a `babel.config.js` file in the root of your project. See [details](https://babeljs.io/docs/en/configuration).
+noBabelrc
+: (`string`) Whether to ignore `.babelrc` and `.babelignore` files. Default is `false`.
-###### minified
+noComments
+: (`bool`) Whether to remove comments. Default is `false`.
-(`bool`) Whether to minify the compiled code. Enables the `compact` option. Default is `false`.
+sourceMap
+: (`string`) Whether to generate source maps, one of `external`, `inline`, or `none`. Default is `none`.
-###### noBabelrc
-(`string`) Whether to ignore `.babelrc` and `.babelignore` files. Default is `false`.
+verbose
+: (`bool`) Whether to enable verbose logging. Default is `false`
-###### noComments
-
-(`bool`) Whether to remove comments. Default is `false`.
-
-###### sourceMap
-
-(`string`) Whether to generate source maps, one of `external`, `inline`, or `none`. Default is `none`.
-
-
-
-###### verbose
-
-(`bool`) Whether to enable verbose logging. Default is `false`
+
diff --git a/content/en/functions/js/Batch.md b/content/en/functions/js/Batch.md
index fe9ec979f..5bce47889 100644
--- a/content/en/functions/js/Batch.md
+++ b/content/en/functions/js/Batch.md
@@ -3,17 +3,16 @@ title: js.Batch
description: Build JavaScript bundle groups with global code splitting and flexible hooks/runners setup.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/js/Build
- - functions/js/Babel
- - functions/resources/Fingerprint
- - functions/resources/Minify
- returnType: js.Batcher
- signatures: ['js.Batch [ID]']
-weight: 20
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/js/Build
+ - functions/js/Babel
+ - functions/resources/Fingerprint
+ - functions/resources/Minify
+ returnType: js.Batcher
+ signatures: ['js.Batch [ID]']
---
{{< note >}}
@@ -22,21 +21,21 @@ For a runnable example of this feature, see [this test and demo repo](https://gi
The Batch `ID` is used to create the base directory for this batch. Forward slashes are allowed. `js.Batch` returns an object with an API with this structure:
-* [Group]
- * [Script]
- * [SetOptions]
- * [Instance]
- * [SetOptions]
- * [Runner]
- * [SetOptions]
- * [Config]
- * [SetOptions]
+- [Group]
+ - [Script]
+ - [SetOptions]
+ - [Instance]
+ - [SetOptions]
+ - [Runner]
+ - [SetOptions]
+ - [Config]
+ - [SetOptions]
## Group
The `Group` method take an `ID` (`string`) as argument. No slashes. It returns an object with these methods:
-#### Script
+### Script
The `Script` method takes an `ID` (`string`) as argument. No slashes. It returns an [OptionsSetter] that can be used to set [script options] for this script.
@@ -50,9 +49,9 @@ The `Script` method takes an `ID` (`string`) as argument. No slashes. It returns
{{ end }}
```
-`SetOptions` takes a [script options] map. Note that if you want the script to be handled by a [runner], you need to set the `export` option to match what you want to pass on to the runner (default is `*`).
+`SetOptions` takes a [script options] map. Note that if you want the script to be handled by a [runner], you need to set the `export` option to match what you want to pass on to the runner (default is `*`).
-#### Instance
+### Instance
The `Instance` method takes two `string` arguments `SCRIPT_ID` and `INSTANCE_ID`. No slashes. It returns an [OptionsSetter] that can be used to set [params options] for this instance.
@@ -68,7 +67,7 @@ The `Instance` method takes two `string` arguments `SCRIPT_ID` and `INSTANCE_ID`
`SetOptions` takes a [params options] map. The instance options will be passed to any [runner] script in the same group, as JSON.
-#### Runner
+### Runner
The `Runner` method takes an `ID` (`string`) as argument. No slashes. It returns an [OptionsSetter] that can be used to set [script options] for this runner.
@@ -131,34 +130,34 @@ import * as ReactDOM from 'react-dom/client';
import * as React from 'react';
export default function Run(group) {
- console.log('Running react-create-elements.js', group);
- const scripts = group.scripts;
- for (const script of scripts) {
- for (const instance of script.instances) {
- /* This is a convention in this project. */
- let elId = `${script.id}-${instance.id}`;
- let el = document.getElementById(elId);
- if (!el) {
- console.warn(`Element with id ${elId} not found`);
- continue;
- }
- const root = ReactDOM.createRoot(el);
- const reactEl = React.createElement(script.binding, instance.params);
- root.render(reactEl);
- }
- }
+ console.log('Running react-create-elements.js', group);
+ const scripts = group.scripts;
+ for (const script of scripts) {
+ for (const instance of script.instances) {
+ /* This is a convention in this project. */
+ let elId = `${script.id}-${instance.id}`;
+ let el = document.getElementById(elId);
+ if (!el) {
+ console.warn(`Element with id ${elId} not found`);
+ continue;
+ }
+ const root = ReactDOM.createRoot(el);
+ const reactEl = React.createElement(script.binding, instance.params);
+ root.render(reactEl);
+ }
+ }
}
```
-#### Config
+### Config
Returns an [OptionsSetter] that can be used to set [build options] for the batch.
These are mostly the same as for `js.Build`, but note that:
-* `targetPath` is set automatically (there may be multiple outputs).
-* `format` must be `esm`, currently the only format supporting [code splitting].
-* `params` will be available in the `@params/config` namespace in the scripts. This way you can import both the [script] or [runner] params and the [config] params with:
+- `targetPath` is set automatically (there may be multiple outputs).
+- ``format` must be `esm`, currently the only format supporting [code splitting].
+- ``params` will be available in the `@params/config` namespace in the scripts. This way you can import both the [script] or [runner] params and the [config] params with:
```js
import * as params from "@params";
@@ -185,14 +184,14 @@ Setting the `Config` for a batch can be done from any template (including shortc
## Options
-### Build Options
+### Build options
format
: (`string`) Currently only `esm` is supported in [ESBuild's code splitting].
-{{% include "./_common/options.md" %}}
+{{% include "/_common/functions/js/options.md" %}}
-### Script Options
+### Script options
resource
: The resource to build. This can be a file resource or a virtual resource.
@@ -205,18 +204,17 @@ importContext
params
: A map of parameters that will be passed to the script as JSON. These gets bound to the `@params` namespace:
-```js
-import * as params from '@params';
-```
-### Script Options
+ ```js
+ import * as params from '@params';
+ ```
-### Params Options
+### Params options
params
-: A map of parameters that will be passed to the script as JSON.
+: A map of parameters that will be passed to the script as JSON.
-### Import Context
+### Import context
Hugo will, by default, first try to resolve any import in [assets](/hugo-pipes/introduction/#asset-directory) and, if not found, let [ESBuild] resolve it (e.g. from `node_modules`). The `importContext` option can be used to set the first context for resolving imports. A common use of this is to resolve imports inside a [page bundle](/content-management/page-bundles/).
@@ -243,12 +241,12 @@ An `OptionsSetter` is a special object that is returned once only. This means th
The `Build` method returns an object with the following structure:
-* Groups (map)
- * [`Resources`]
+- Groups (map)
+ - [`Resources`]
-Eeach [`Resource`] will be of media type `application/javascript` or `text/css`.
+Each [`Resource`] will be of media type `application/javascript` or `text/css`.
- In a template you would typically handle one group with a given `ID` (e.g. scripts for the current section). Because of the concurrent build, this needs to be done in a [`templates.Defer`] block:
+In a template you would typically handle one group with a given `ID` (e.g. scripts for the current section). Because of the concurrent build, this needs to be done in a [`templates.Defer`] block:
{{< note >}}
The [`templates.Defer`] acts as a synchronisation point to handle scripts added concurrently by different templates. If you have a setup with where the batch is created in one go (in one template), you don't need it.
@@ -281,8 +279,8 @@ See [this discussion](https://discourse.gohugo.io/t/js-batch-with-simple-global-
In the official documentation for [ESBuild's code splitting], there's a warning note in the header. The two issues are:
-* `esm` is currently the only implemented output format. This means that it will not work for very old browsers. See [caniuse](https://caniuse.com/?search=ESM).
-* There's a known import ordering issue.
+ - `esm` is currently the only implemented output format. This means that it will not work for very old browsers. See [caniuse](https://caniuse.com/?search=ESM).
+ - There's a known import ordering issue.
We have not seen the ordering issue as a problem during our [extensive testing](https://github.com/bep/hugojsbatchdemo) of this new feature with different libraries. There are two main cases:
diff --git a/content/en/functions/js/Build.md b/content/en/functions/js/Build.md
index 497e19203..137c8a50f 100644
--- a/content/en/functions/js/Build.md
+++ b/content/en/functions/js/Build.md
@@ -3,17 +3,16 @@ title: js.Build
description: Bundle, transpile, tree shake, and minify JavaScript resources.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/js/Batch
- - functions/js/Babel
- - functions/resources/Fingerprint
- - functions/resources/Minify
- returnType: resource.Resource
- signatures: ['js.Build [OPTIONS] RESOURCE']
-weight: 10
-toc: true
+params:
+ functions_and_methods:
+ aliases: []
+ related:
+ - functions/js/Batch
+ - functions/js/Babel
+ - functions/resources/Fingerprint
+ - functions/resources/Minify
+ returnType: resource.Resource
+ signatures: ['js.Build [OPTIONS] RESOURCE']
---
The `js.Build` function uses the [evanw/esbuild] package to:
@@ -48,13 +47,12 @@ The `js.Build` function uses the [evanw/esbuild] package to:
## Options
targetPath
-: (`string`) If not set, the source path will be used as the base target path.
-Note that the target path's extension may change if the target MIME type is different, e.g. when the source is TypeScript.
+: (`string`) If not set, the source path will be used as the base target path. Note that the target path's extension may change if the target MIME type is different, e.g. when the source is TypeScript.
format
: (`string`) The output format. One of: `iife`, `cjs`, `esm`. Default is `iife`, a self-executing function, suitable for inclusion as a `
{{ end }}
```
-
-{{% include "methods/resource/_common/global-page-remote-resources.md" %}}
diff --git a/content/en/methods/resource/Crop.md b/content/en/methods/resource/Crop.md
index 711fc07b0..e6873d418 100644
--- a/content/en/methods/resource/Crop.md
+++ b/content/en/methods/resource/Crop.md
@@ -3,18 +3,20 @@ title: Crop
description: Applicable to images, returns an image resource cropped to the given dimensions without resizing.
categories: []
keywords: []
-action:
- related:
- - methods/resource/Fit
- - methods/resource/Fill
- - methods/resource/Resize
- - methods/resource/Process
- - functions/images/Process
- returnType: images.ImageResource
- signatures: [RESOURCE.Crop SPEC]
-toc: true
+params:
+ functions_and_methods:
+ related:
+ - methods/resource/Fit
+ - methods/resource/Fill
+ - methods/resource/Resize
+ - methods/resource/Process
+ - functions/images/Process
+ returnType: images.ImageResource
+ signatures: [RESOURCE.Crop SPEC]
---
+{{% include "/_common/methods/resource/global-page-remote-resources.md" %}}
+
Crop an image to match the given dimensions without resizing. You must provide both width and height.
```go-html-template
@@ -25,9 +27,7 @@ Crop an image to match the given dimensions without resizing. You must provide b
{{ end }}
```
-{{% include "methods/resource/_common/global-page-remote-resources.md" %}}
-
-{{% include "/methods/resource/_common/processing-spec.md" %}}
+{{% include "/_common/methods/resource/processing-spec.md" %}}
## Example
diff --git a/content/en/methods/resource/Data.md b/content/en/methods/resource/Data.md
index b6744d1be..8ba05dfe3 100644
--- a/content/en/methods/resource/Data.md
+++ b/content/en/methods/resource/Data.md
@@ -3,18 +3,21 @@ title: Data
description: Applicable to resources returned by the resources.GetRemote function, returns information from the HTTP response.
categories: []
keywords: []
-action:
- related:
- - functions/resources/GetRemote
- - methods/resource/Err
- returnType: map
- signatures: [RESOURCE.Data]
+params:
+ functions_and_methods:
+ related:
+ - functions/resources/GetRemote
+ - methods/resource/Err
+ returnType: map
+ signatures: [RESOURCE.Data]
---
The `Data` method on a resource returned by the [`resources.GetRemote`] function returns information from the HTTP response.
[`resources.GetRemote`]: /functions/resources/getremote/
+## Example
+
```go-html-template
{{ $url := "https://example.org/images/a.jpg" }}
{{ $opts := dict "responseHeaders" (slice "Server") }}
@@ -36,30 +39,31 @@ The `Data` method on a resource returned by the [`resources.GetRemote`] function
{{ end }}
```
-###### ContentLength
+## Methods
+
+### ContentLength
(`int`) The content length in bytes.
-###### ContentType
+### ContentType
(`string`) The content type.
-###### Headers
+### Headers
(`map[string][]string`) A map of response headers matching those requested in the [`responseHeaders`] option passed to the `resources.GetRemote` function. The header name matching is case-insensitive. In most cases there will be one value per header key.
-[`responseHeaders`]: /functions/resources/getremote/#responseheaders
-
-###### Status
+### Status
(`string`) The HTTP status text.
-###### StatusCode
+### StatusCode
(`int`) The HTTP status code.
-###### TransferEncoding
+### TransferEncoding
(`string`) The transfer encoding.
[`resources.GetRemote`]: /functions/resources/getremote/
+[`responseHeaders`]: /functions/resources/getremote/#responseheaders
diff --git a/content/en/methods/resource/Err.md b/content/en/methods/resource/Err.md
index 11c1dd77b..20a05040d 100644
--- a/content/en/methods/resource/Err.md
+++ b/content/en/methods/resource/Err.md
@@ -1,14 +1,15 @@
---
title: Err
-description: Applicable to resources returned by the resources.GetRemote function, returns an error message if the HTTP request fails, else nil.
+description: Applicable to resources returned by the resources.GetRemote function, returns an error message if the HTTP request fails, else nil.
categories: []
keywords: []
-action:
- related:
- - functions/resources/GetRemote
- - methods/resource/Data
- returnType: resource.resourceError
- signatures: [RESOURCE.Err]
+params:
+ functions_and_methods:
+ related:
+ - functions/resources/GetRemote
+ - methods/resource/Data
+ returnType: resource.resourceError
+ signatures: [RESOURCE.Err]
expiryDate: 2027-01-16 # deprecated 2025-01-16 in v0.141.0
---
diff --git a/content/en/methods/resource/Exif.md b/content/en/methods/resource/Exif.md
index a8e5a42aa..f624d23e9 100644
--- a/content/en/methods/resource/Exif.md
+++ b/content/en/methods/resource/Exif.md
@@ -3,28 +3,36 @@ title: Exif
description: Applicable to JPEG, PNG, TIFF, and WebP images, returns an EXIF object containing image metadata.
categories: []
keywords: []
-action:
- related: []
- returnType: exif.ExifInfo
- signatures: [RESOURCE.Exif]
-toc: true
+params:
+ functions_and_methods:
+ related: []
+ returnType: exif.ExifInfo
+ signatures: [RESOURCE.Exif]
---
+{{% include "/_common/methods/resource/global-page-remote-resources.md" %}}
+
Applicable to JPEG, PNG, TIFF, and WebP images, the `Exif` method on an image `Resource` object returns an [EXIF] object containing image metadata.
## Methods
-Date
-: (`time.Time`) Returns the image creation date/time. Format with the [`time.Format`] function.
+### Date
-Lat
-: (`float64`) Returns the GPS latitude in degrees.
+(`time.Time`) Returns the image creation date/time. Format with the [`time.Format`] function.
-Long
-: (`float64`) Returns the GPS longitude in degrees.
+### Lat
-Tags
-: (`exif.Tags`) Returns a collection of the available EXIF tags for this image. You may include or exclude specific tags from this collection in the [site configuration].
+(`float64`) Returns the GPS latitude in degrees.
+
+### Long
+
+(`float64`) Returns the GPS longitude in degrees.
+
+### Tags
+
+(`exif.Tags`) Returns a collection of the available EXIF tags for this image. You may include or exclude specific tags from this collection. See [configure imaging].
+
+[configure imaging]: /configuration/imaging/#exif-data
## Examples
@@ -71,8 +79,5 @@ To list specific values:
{{ end }}
```
-{{% include "methods/resource/_common/global-page-remote-resources.md" %}}
-
[exif]: https://en.wikipedia.org/wiki/Exif
-[site configuration]: /content-management/image-processing/#exif-data
[`time.Format`]: /functions/time/format/
diff --git a/content/en/methods/resource/Fill.md b/content/en/methods/resource/Fill.md
index 8bbaf93ee..3c067620b 100644
--- a/content/en/methods/resource/Fill.md
+++ b/content/en/methods/resource/Fill.md
@@ -1,20 +1,22 @@
---
title: Fill
-description: Applicable to images, returns an image resource cropped and resized to the given dimensions.
+description: Applicable to images, returns an image resource cropped and resized to the given dimensions.
categories: []
keywords: []
-action:
- related:
- - methods/resource/Crop
- - methods/resource/Fit
- - methods/resource/Resize
- - methods/resource/Process
- - functions/images/Process
- returnType: images.ImageResource
- signatures: [RESOURCE.Fill SPEC]
-toc: true
+params:
+ functions_and_methods:
+ related:
+ - methods/resource/Crop
+ - methods/resource/Fit
+ - methods/resource/Resize
+ - methods/resource/Process
+ - functions/images/Process
+ returnType: images.ImageResource
+ signatures: [RESOURCE.Fill SPEC]
---
+{{% include "/_common/methods/resource/global-page-remote-resources.md" %}}
+
Crop and resize an image to match the given dimensions. You must provide both width and height.
```go-html-template
@@ -25,9 +27,7 @@ Crop and resize an image to match the given dimensions. You must provide both wi
{{ end }}
```
-{{% include "methods/resource/_common/global-page-remote-resources.md" %}}
-
-{{% include "/methods/resource/_common/processing-spec.md" %}}
+{{% include "/_common/methods/resource/processing-spec.md" %}}
## Example
diff --git a/content/en/methods/resource/Filter.md b/content/en/methods/resource/Filter.md
index 2b059c993..e44deb23d 100644
--- a/content/en/methods/resource/Filter.md
+++ b/content/en/methods/resource/Filter.md
@@ -3,14 +3,16 @@ title: Filter
description: Applicable to images, applies one or more image filters to the given image resource.
categories: []
keywords: []
-action:
- related:
- - functions/images/Filter
- returnType: images.ImageResource
- signatures: [RESOURCE.Filter FILTER...]
-toc: true
+params:
+ functions_and_methods:
+ related:
+ - functions/images/Filter
+ returnType: images.ImageResource
+ signatures: [RESOURCE.Filter FILTER...]
---
+{{% include "/_common/methods/resource/global-page-remote-resources.md" %}}
+
Apply one or more [image filters](#image-filters) to the given image.
To apply a single filter:
@@ -41,8 +43,6 @@ You can also apply image filters using the [`images.Filter`] function.
[`images.Filter`]: /functions/images/filter/
-{{% include "methods/resource/_common/global-page-remote-resources.md" %}}
-
## Example
```go-html-template
diff --git a/content/en/methods/resource/Fit.md b/content/en/methods/resource/Fit.md
index 13354fe5a..e4abe0018 100644
--- a/content/en/methods/resource/Fit.md
+++ b/content/en/methods/resource/Fit.md
@@ -1,20 +1,22 @@
---
title: Fit
-description: Applicable to images, returns an image resource downscaled to fit the given dimensions while maintaining aspect ratio.
+description: Applicable to images, returns an image resource downscaled to fit the given dimensions while maintaining aspect ratio.
categories: []
keywords: []
-action:
- related:
- - methods/resource/Crop
- - methods/resource/Fill
- - methods/resource/Resize
- - methods/resource/Process
- - functions/images/Process
- returnType: images.ImageResource
- signatures: [RESOURCE.Fit SPEC]
-toc: true
+params:
+ functions_and_methods:
+ related:
+ - methods/resource/Crop
+ - methods/resource/Fill
+ - methods/resource/Resize
+ - methods/resource/Process
+ - functions/images/Process
+ returnType: images.ImageResource
+ signatures: [RESOURCE.Fit SPEC]
---
+{{% include "/_common/methods/resource/global-page-remote-resources.md" %}}
+
Downscale an image to fit the given dimensions while maintaining aspect ratio. You must provide both width and height.
```go-html-template
@@ -25,9 +27,7 @@ Downscale an image to fit the given dimensions while maintaining aspect ratio. Y
{{ end }}
```
-{{% include "methods/resource/_common/global-page-remote-resources.md" %}}
-
-{{% include "/methods/resource/_common/processing-spec.md" %}}
+{{% include "/_common/methods/resource/processing-spec.md" %}}
## Example
diff --git a/content/en/methods/resource/Height.md b/content/en/methods/resource/Height.md
index dcaf6c514..40b8b70d9 100644
--- a/content/en/methods/resource/Height.md
+++ b/content/en/methods/resource/Height.md
@@ -3,13 +3,16 @@ title: Height
description: Applicable to images, returns the height of the given resource.
categories: []
keywords: []
-action:
- related:
- - methods/resource/Width
- returnType: int
- signatures: [RESOURCE.Height]
+params:
+ functions_and_methods:
+ related:
+ - methods/resource/Width
+ returnType: int
+ signatures: [RESOURCE.Height]
---
+{{% include "/_common/methods/resource/global-page-remote-resources.md" %}}
+
```go-html-template
{{ with resources.Get "images/a.jpg" }}
{{ .Height }} → 400
@@ -23,5 +26,3 @@ Use the `Width` and `Height` methods together when rendering an `img` element:
{{ end }}
```
-
-{{% include "methods/resource/_common/global-page-remote-resources.md" %}}
diff --git a/content/en/methods/resource/Key.md b/content/en/methods/resource/Key.md
deleted file mode 100644
index 2dbd371be..000000000
--- a/content/en/methods/resource/Key.md
+++ /dev/null
@@ -1,45 +0,0 @@
----
-title: Key
-description: Returns the unique key for the given resource, equivalent to its publishing path.
-draft: true
-categories: []
-keywords: []
-action:
- related:
- - methods/resource/Permalink
- - methods/resource/RelPermalink
- - methods/resource/Publish
- returnType: string
- signatures: [RESOURCE.Key]
----
-
-By way of example, consider this site configuration:
-
-{{< code-toggle file=hugo >}}
-baseURL = 'https://example.org/docs/'
-{{< /code-toggle >}}
-
-And this template:
-
-```go-html-template
- {{ with resources.Get "images/a.jpg" }}
- {{ with resources.Copy "foo/bar/b.jpg" . }}
- {{ .Key }} → foo/bar/b.jpg
-
- {{ .Name }} → images/a.jpg
- {{ .Title }} → images/a.jpg
-
- {{ .RelPermalink }} → /docs/foo/bar/b.jpg
- {{ end }}
- {{ end }}
-```
-
-We used the [`resources.Copy`] function to change the publishing path. The `Key` method returns the updated path, but note that it is different than the value returned by [`RelPermalink`]. The `RelPermalink` value includes the subdirectory segment of the `baseURL` in the site configuration.
-
-The `Key` method is useful if you need to get the resource's publishing path without publishing the resource. Unlike the `Permalink`, `RelPermalink`, or `Publish` methods, calling `Key` will not publish the resource.
-
-{{% include "methods/resource/_common/global-page-remote-resources.md" %}}
-
-[`Permalink`]: /methods/resource/permalink/
-[`RelPermalink`]: /methods/resource/relpermalink/
-[`resources.Copy`]: /functions/resources/copy/
diff --git a/content/en/methods/resource/MediaType.md b/content/en/methods/resource/MediaType.md
index 6dea8706c..51a3e1364 100644
--- a/content/en/methods/resource/MediaType.md
+++ b/content/en/methods/resource/MediaType.md
@@ -3,18 +3,22 @@ title: MediaType
description: Returns a media type object for the given resource.
categories: []
keywords: []
-action:
- related: []
- returnType: media.Type
- signatures: [RESOURCE.MediaType]
+params:
+ functions_and_methods:
+ related: []
+ returnType: media.Type
+ signatures: [RESOURCE.MediaType]
---
+{{% include "/_common/methods/resource/global-page-remote-resources.md" %}}
+
The `MediaType` method on a `Resource` object returns an object with additional methods.
## Methods
-Type
-: (`string`) The resource's media type.
+### Type
+
+(`string`) The resource's media type.
```go-html-template
{{ with resources.Get "images/a.jpg" }}
@@ -22,8 +26,9 @@ Type
{{ end }}
```
-MainType
-: (`string`) The main type of the resource’s media type.
+### MainType
+
+(`string`) The main type of the resource's media type.
```go-html-template
{{ with resources.Get "images/a.jpg" }}
@@ -31,8 +36,9 @@ MainType
{{ end }}
```
-SubType
-: (`string`) The subtype of the resource’s media type. This may or may not correspond to the file suffix.
+### SubType
+
+(`string`) The subtype of the resource's media type. This may or may not correspond to the file suffix.
```go-html-template
{{ with resources.Get "images/a.jpg" }}
@@ -40,8 +46,9 @@ SubType
{{ end }}
```
-Suffixes
-: (`slice`) A slice of possible file suffixes for the resource’s media type.
+### Suffixes
+
+(`slice`) A slice of possible file suffixes for the resource's media type.
```go-html-template
{{ with resources.Get "images/a.jpg" }}
@@ -49,4 +56,12 @@ Suffixes
{{ end }}
```
-{{% include "methods/resource/_common/global-page-remote-resources.md" %}}
+### FirstSuffix.Suffix
+
+(`string`) The first of the possible file suffixes for the resource's media type.
+
+```go-html-template
+{{ with resources.Get "images/a.jpg" }}
+ {{ .MediaType.FirstSuffix.Suffix }} → jpg
+{{ end }}
+```
diff --git a/content/en/methods/resource/Name.md b/content/en/methods/resource/Name.md
index 28ccf3abf..d10a77933 100644
--- a/content/en/methods/resource/Name.md
+++ b/content/en/methods/resource/Name.md
@@ -3,12 +3,12 @@ title: Name
description: Returns the name of the given resource as optionally defined in front matter, falling back to its file path.
categories: []
keywords: []
-action:
- related:
- - methods/resource/Title
- returnType: string
- signatures: [RESOURCE.Name]
-toc: true
+params:
+ functions_and_methods:
+ related:
+ - methods/resource/Title
+ returnType: string
+ signatures: [RESOURCE.Name]
---
The value returned by the `Name` method on a `Resource` object depends on the resource type.
diff --git a/content/en/methods/resource/Params.md b/content/en/methods/resource/Params.md
index a171b3ddf..59183c4c3 100644
--- a/content/en/methods/resource/Params.md
+++ b/content/en/methods/resource/Params.md
@@ -3,10 +3,11 @@ title: Params
description: Returns a map of resource parameters as defined in front matter.
categories: []
keywords: []
-action:
- related: []
- returnType: map
- signatures: [RESOURCE.Params]
+params:
+ functions_and_methods:
+ related: []
+ returnType: map
+ signatures: [RESOURCE.Params]
---
Use the `Params` method with [page resources](g). It is not applicable to either [global resources](g) or [remote resources](g).
diff --git a/content/en/methods/resource/Permalink.md b/content/en/methods/resource/Permalink.md
index 4c87b4b46..99e8ceb45 100644
--- a/content/en/methods/resource/Permalink.md
+++ b/content/en/methods/resource/Permalink.md
@@ -1,16 +1,19 @@
---
title: Permalink
-description: Publishes the given resource and returns its permalink.
+description: Publishes the given resource and returns its permalink.
categories: []
keywords: []
-action:
- related:
- - methods/resource/RelPermalink
- - methods/resource/Publish
- returnType: string
- signatures: [RESOURCE.Permalink]
+params:
+ functions_and_methods:
+ related:
+ - methods/resource/RelPermalink
+ - methods/resource/Publish
+ returnType: string
+ signatures: [RESOURCE.Permalink]
---
+{{% include "/_common/methods/resource/global-page-remote-resources.md" %}}
+
The `Permalink` method on a `Resource` object writes the resource to the publish directory, typically `public`, and returns its [permalink](g).
```go-html-template
@@ -18,5 +21,3 @@ The `Permalink` method on a `Resource` object writes the resource to the publish
{{ .Permalink }} → https://example.org/images/a.jpg
{{ end }}
```
-
-{{% include "methods/resource/_common/global-page-remote-resources.md" %}}
diff --git a/content/en/methods/resource/Process.md b/content/en/methods/resource/Process.md
index 550b06401..d805e129f 100644
--- a/content/en/methods/resource/Process.md
+++ b/content/en/methods/resource/Process.md
@@ -3,18 +3,20 @@ title: Process
description: Applicable to images, returns an image resource processed with the given specification.
categories: []
keywords: []
-action:
- related:
- - methods/resource/Crop
- - methods/resource/Fit
- - methods/resource/Fill
- - methods/resource/Resize
- - functions/images/Process
- returnType: images.ImageResource
- signatures: [RESOURCE.Process SPEC]
-toc: true
+params:
+ functions_and_methods:
+ related:
+ - methods/resource/Crop
+ - methods/resource/Fit
+ - methods/resource/Fill
+ - methods/resource/Resize
+ - functions/images/Process
+ returnType: images.ImageResource
+ signatures: [RESOURCE.Process SPEC]
---
+{{% include "/_common/methods/resource/global-page-remote-resources.md" %}}
+
Process an image with the given specification. The specification can contain an optional action, one of `crop`, `fill`, `fit`, or `resize`. This means that you can use this method instead of [`Crop`], [`Fill`], [`Fit`], or [`Resize`].
```go-html-template
@@ -37,9 +39,7 @@ You can also use this method to apply simple transformations such as rotation an
The `Process` method is also available as a filter, which is more effective if you need to apply multiple filters to an image. See [`images.Process`].
-{{% include "methods/resource/_common/global-page-remote-resources.md" %}}
-
-{{% include "/methods/resource/_common/processing-spec.md" %}}
+{{% include "/_common/methods/resource/processing-spec.md" %}}
## Example
diff --git a/content/en/methods/resource/Publish.md b/content/en/methods/resource/Publish.md
index 05344c658..fc9d9a234 100644
--- a/content/en/methods/resource/Publish.md
+++ b/content/en/methods/resource/Publish.md
@@ -3,14 +3,17 @@ title: Publish
description: Publishes the given resource.
categories: []
keywords: []
-action:
- related:
- - methods/resource/Permalink
- - methods/resource/RelPermalink
- returnType: nil
- signatures: [RESOURCE.Publish]
+params:
+ functions_and_methods:
+ related:
+ - methods/resource/Permalink
+ - methods/resource/RelPermalink
+ returnType: nil
+ signatures: [RESOURCE.Publish]
---
+{{% include "/_common/methods/resource/global-page-remote-resources.md" %}}
+
The `Publish` method on a `Resource` object writes the resource to the publish directory, typically `public`.
```go-html-template
@@ -30,5 +33,3 @@ Instead of this:
```go-html-template
{{ $noop := $resource.Permalink }}
```
-
-{{% include "methods/resource/_common/global-page-remote-resources.md" %}}
diff --git a/content/en/methods/resource/RelPermalink.md b/content/en/methods/resource/RelPermalink.md
index a7226b057..723c8c71d 100644
--- a/content/en/methods/resource/RelPermalink.md
+++ b/content/en/methods/resource/RelPermalink.md
@@ -3,14 +3,17 @@ title: RelPermalink
description: Publishes the given resource and returns its relative permalink.
categories: []
keywords: []
-action:
- related:
- - methods/resource/Permalink
- - methods/resource/Publish
- returnType: string
- signatures: [RESOURCE.RelPermalink]
+params:
+ functions_and_methods:
+ related:
+ - methods/resource/Permalink
+ - methods/resource/Publish
+ returnType: string
+ signatures: [RESOURCE.RelPermalink]
---
+{{% include "/_common/methods/resource/global-page-remote-resources.md" %}}
+
The `Permalink` method on a `Resource` object writes the resource to the publish directory, typically `public`, and returns its [relative permalink](g).
```go-html-template
@@ -18,5 +21,3 @@ The `Permalink` method on a `Resource` object writes the resource to the publish
{{ .RelPermalink }} → /images/a.jpg
{{ end }}
```
-
-{{% include "methods/resource/_common/global-page-remote-resources.md" %}}
diff --git a/content/en/methods/resource/Resize.md b/content/en/methods/resource/Resize.md
index 4ba054bb5..4f7587094 100644
--- a/content/en/methods/resource/Resize.md
+++ b/content/en/methods/resource/Resize.md
@@ -3,17 +3,20 @@ title: Resize
description: Applicable to images, returns an image resource resized to the given width and/or height.
categories: []
keywords: []
-action:
- related:
- - methods/resource/Crop
- - methods/resource/Fit
- - methods/resource/Fill
- - methods/resource/Process
- - functions/images/Process
- returnType: images.ImageResource
- signatures: [RESOURCE.Resize SPEC]
+params:
+ functions_and_methods:
+ related:
+ - methods/resource/Crop
+ - methods/resource/Fit
+ - methods/resource/Fill
+ - methods/resource/Process
+ - functions/images/Process
+ returnType: images.ImageResource
+ signatures: [RESOURCE.Resize SPEC]
---
+{{% include "/_common/methods/resource/global-page-remote-resources.md" %}}
+
Resize an image to the given width and/or height.
If you specify both width and height, the resulting image will be disproportionally scaled unless the original image has the same aspect ratio.
@@ -26,9 +29,7 @@ If you specify both width and height, the resulting image will be disproportiona
{{ end }}
```
-{{% include "methods/resource/_common/global-page-remote-resources.md" %}}
-
-{{% include "/methods/resource/_common/processing-spec.md" %}}
+{{% include "/_common/methods/resource/processing-spec.md" %}}
## Example
diff --git a/content/en/methods/resource/ResourceType.md b/content/en/methods/resource/ResourceType.md
index db52e7b10..56e60856f 100644
--- a/content/en/methods/resource/ResourceType.md
+++ b/content/en/methods/resource/ResourceType.md
@@ -3,12 +3,15 @@ title: ResourceType
description: Returns the main type of the given resource's media type.
categories: []
keywords: []
-action:
- related: []
- returnType: string
- signatures: [RESOURCE.ResourceType]
+params:
+ functions_and_methods:
+ related: []
+ returnType: string
+ signatures: [RESOURCE.ResourceType]
---
+{{% include "/_common/methods/resource/global-page-remote-resources.md" %}}
+
Common resource types include `audio`, `image`, `text`, and `video`.
```go-html-template
@@ -34,10 +37,8 @@ content/
With the structure above, we can range through page resources of type `page` to build content:
-{{< code file=layouts/lessons/single.html >}}
+{{< code file=layouts/lessons/single.html >}}
{{ range .Resources.ByType "page" }}
{{ .Content }}
{{ end }}
{{< /code >}}
-
-{{% include "methods/resource/_common/global-page-remote-resources.md" %}}
diff --git a/content/en/methods/resource/Title.md b/content/en/methods/resource/Title.md
index 1a984f902..d3e9c5d5b 100644
--- a/content/en/methods/resource/Title.md
+++ b/content/en/methods/resource/Title.md
@@ -3,12 +3,12 @@ title: Title
description: Returns the title of the given resource as optionally defined in front matter, falling back to a relative path or hashed file name depending on resource type.
categories: []
keywords: []
-action:
- related:
- - methods/resource/Name
- returnType: string
- signatures: [RESOURCE.Title]
-toc: true
+params:
+ functions_and_methods:
+ related:
+ - methods/resource/Name
+ returnType: string
+ signatures: [RESOURCE.Title]
---
The value returned by the `Title` method on a `Resource` object depends on the resource type.
diff --git a/content/en/methods/resource/Width.md b/content/en/methods/resource/Width.md
index 8b96c95e8..f31fb62bc 100644
--- a/content/en/methods/resource/Width.md
+++ b/content/en/methods/resource/Width.md
@@ -3,13 +3,16 @@ title: Width
description: Applicable to images, returns the width of the given resource.
categories: []
keywords: []
-action:
- related:
- - methods/resource/Height
- returnType: int
- signatures: [RESOURCE.Width]
+params:
+ functions_and_methods:
+ related:
+ - methods/resource/Height
+ returnType: int
+ signatures: [RESOURCE.Width]
---
+{{% include "/_common/methods/resource/global-page-remote-resources.md" %}}
+
```go-html-template
{{ with resources.Get "images/a.jpg" }}
{{ .Width }} → 600
@@ -23,5 +26,3 @@ Use the `Width` and `Height` methods together when rendering an `img` element:
{{ end }}
```
-
-{{% include "methods/resource/_common/global-page-remote-resources.md" %}}
diff --git a/content/en/methods/resource/_common/_index.md b/content/en/methods/resource/_common/_index.md
deleted file mode 100644
index 4328d4d14..000000000
--- a/content/en/methods/resource/_common/_index.md
+++ /dev/null
@@ -1,13 +0,0 @@
----
-cascade:
- _build:
- list: never
- publishResources: false
- render: never
----
-
-
diff --git a/content/en/methods/resource/_index.md b/content/en/methods/resource/_index.md
index e9426e1a5..edfbc5b14 100644
--- a/content/en/methods/resource/_index.md
+++ b/content/en/methods/resource/_index.md
@@ -4,9 +4,4 @@ linkTitle: Resource
description: Use these methods with global, page, and remote Resource objects.
categories: []
keywords: []
-menu:
- docs:
- parent: methods
---
-
-Use these methods with global, page, and remote Resource objects.
diff --git a/content/en/methods/shortcode/Get.md b/content/en/methods/shortcode/Get.md
index ec37fddd5..04ce6ad0b 100644
--- a/content/en/methods/shortcode/Get.md
+++ b/content/en/methods/shortcode/Get.md
@@ -3,13 +3,13 @@ title: Get
description: Returns the value of the given argument.
categories: []
keywords: []
-action:
- related:
- - methods/shortcode/IsNamedParams
- - methods/shortcode/Params
- returnType: any
- signatures: [SHORTCODE.Get ARG]
-toc: true
+params:
+ functions_and_methods:
+ related:
+ - methods/shortcode/IsNamedParams
+ - methods/shortcode/Params
+ returnType: any
+ signatures: [SHORTCODE.Get ARG]
---
Specify the argument by position or by name. When calling a shortcode within Markdown, use either positional or named argument, but not both.
@@ -22,13 +22,13 @@ Some shortcodes support positional arguments, some support named arguments, and
This shortcode call uses positional arguments:
-{{< code file=content/about.md lang=md >}}
+{{< code file=content/about.md lang=text >}}
{{* myshortcode "Hello" "world" */>}}
{{< /code >}}
To retrieve arguments by position:
-{{< code file=layouts/shortcodes/myshortcode.html >}}
+{{< code file=layouts/shortcodes/myshortcode.html >}}
{{ printf "%s %s." (.Get 0) (.Get 1) }} → Hello world.
{{< /code >}}
@@ -36,13 +36,13 @@ To retrieve arguments by position:
This shortcode call uses named arguments:
-{{< code file=content/about.md lang=md >}}
+{{< code file=content/about.md lang=text >}}
{{* myshortcode greeting="Hello" firstName="world" */>}}
{{< /code >}}
To retrieve arguments by name:
-{{< code file=layouts/shortcodes/myshortcode.html >}}
+{{< code file=layouts/shortcodes/myshortcode.html >}}
{{ printf "%s %s." (.Get "greeting") (.Get "firstName") }} → Hello world.
{{< /code >}}
diff --git a/content/en/methods/shortcode/Inner.md b/content/en/methods/shortcode/Inner.md
index bf70f0f9a..698b44ac1 100644
--- a/content/en/methods/shortcode/Inner.md
+++ b/content/en/methods/shortcode/Inner.md
@@ -3,20 +3,20 @@ title: Inner
description: Returns the content between opening and closing shortcode tags, applicable when the shortcode call includes a closing tag.
categories: []
keywords: []
-action:
- related:
- - functions/strings/Trim
- - methods/page/RenderString
- - functions/transform/Markdownify
- - methods/shortcode/InnerDeindent
- returnType: template.HTML
- signatures: [SHORTCODE.Inner]
-toc: true
+params:
+ functions_and_methods:
+ related:
+ - functions/strings/Trim
+ - methods/page/RenderString
+ - functions/transform/Markdownify
+ - methods/shortcode/InnerDeindent
+ returnType: template.HTML
+ signatures: [SHORTCODE.Inner]
---
This content:
-{{< code file=content/services.md lang=md >}}
+{{< code file=content/services.md lang=text >}}
{{* card title="Product Design" */>}}
We design the **best** widgets in the world.
{{* /card */>}}
@@ -24,7 +24,7 @@ We design the **best** widgets in the world.
With this shortcode:
-{{< code file=layouts/shortcodes/card.html >}}
+{{< code file=layouts/shortcodes/card.html >}}
{{ with .Get "title" }}
{{ . }}
@@ -62,7 +62,7 @@ Let's modify the example above to pass the value returned by `Inner` through the
[`RenderString`]: /methods/page/renderstring/
-{{< code file=layouts/shortcodes/card.html >}}
+{{< code file=layouts/shortcodes/card.html >}}
{{ with .Get "title" }}
{{ . }}
@@ -93,7 +93,7 @@ You can use the [`markdownify`] function instead of the `RenderString` method, b
Instead of calling the shortcode with the `{{* */>}}` notation, use the `{{%/* */%}}` notation:
-{{< code file=content/services.md lang=md >}}
+{{< code file=content/services.md lang=text >}}
{{%/* card title="Product Design" */%}}
We design the **best** widgets in the world.
{{%/* /card */%}}
@@ -112,7 +112,7 @@ This configuration is not unsafe if _you_ control the content. Read more about H
Second, because we are rendering the entire shortcode as Markdown, we must adhere to the rules governing [indentation] and inclusion of [raw HTML blocks] as provided in the [CommonMark] specification.
-{{< code file=layouts/shortcodes/card.html >}}
+{{< code file=layouts/shortcodes/card.html >}}
{{ with .Get "title" }}
{{ . }}
diff --git a/content/en/methods/shortcode/InnerDeindent.md b/content/en/methods/shortcode/InnerDeindent.md
index ab4263709..d45e9eb96 100644
--- a/content/en/methods/shortcode/InnerDeindent.md
+++ b/content/en/methods/shortcode/InnerDeindent.md
@@ -1,13 +1,14 @@
---
title: InnerDeindent
-description: Returns the content between opening and closing shortcode tags, with indentation removed, applicable when the shortcode call includes a closing tag.
+description: Returns the content between opening and closing shortcode tags, with indentation removed, applicable when the shortcode call includes a closing tag.
categories: []
keywords: []
-action:
- related:
- - methods/shortcode/Inner
- returnType: template.HTML
- signatures: [SHORTCODE.InnerDeindent]
+params:
+ functions_and_methods:
+ related:
+ - methods/shortcode/Inner
+ returnType: template.HTML
+ signatures: [SHORTCODE.InnerDeindent]
---
Similar to the [`Inner`] method, `InnerDeindent` returns the content between opening and closing shortcode tags. However, with `InnerDeindent`, indentation before the content is removed.
@@ -16,7 +17,7 @@ This allows us to effectively bypass the rules governing [indentation] as provid
Consider this Markdown, an unordered list with a small gallery of thumbnail images within each list item:
-{{< code file=content/about.md lang=md >}}
+{{< code file=content/about.md lang=text >}}
- Gallery one
{{* gallery */>}}
@@ -36,7 +37,7 @@ In the example above, notice that the content between the opening and closing sh
With this shortcode, calling `Inner` instead of `InnerDeindent`:
-{{< code file=layouts/shortcodes/gallery.html >}}
+{{< code file=layouts/shortcodes/gallery.html >}}
{{ .Inner | strings.TrimSpace | .Page.RenderString }}
@@ -67,7 +68,7 @@ Hugo renders the Markdown to:
Although technically correct per the CommonMark specification, this is not what we want. If we remove the indentation using the `InnerDeindent` method:
-{{< code file=layouts/shortcodes/gallery.html >}}
+{{< code file=layouts/shortcodes/gallery.html >}}
{{ .InnerDeindent | strings.TrimSpace | .Page.RenderString }}
diff --git a/content/en/methods/shortcode/IsNamedParams.md b/content/en/methods/shortcode/IsNamedParams.md
index a1d93ddac..782e6baa4 100644
--- a/content/en/methods/shortcode/IsNamedParams.md
+++ b/content/en/methods/shortcode/IsNamedParams.md
@@ -3,18 +3,19 @@ title: IsNamedParams
description: Reports whether the shortcode call uses named arguments.
categories: []
keywords: []
-action:
- related:
- - methods/shortcode/Get
- returnType: bool
- signatures: [SHORTCODE.IsNamedParams]
+params:
+ functions_and_methods:
+ related:
+ - methods/shortcode/Get
+ returnType: bool
+ signatures: [SHORTCODE.IsNamedParams]
---
To support both positional and named arguments when calling a shortcode, use the `IsNamedParams` method to determine how the shortcode was called.
With this shortcode template:
-{{< code file=layouts/shortcodes/myshortcode.html >}}
+{{< code file=layouts/shortcodes/myshortcode.html >}}
{{ if .IsNamedParams }}
{{ printf "%s %s." (.Get "greeting") (.Get "firstName") }}
{{ else }}
@@ -24,7 +25,7 @@ With this shortcode template:
Both of these calls return the same value:
-{{< code file=content/about.md lang=md >}}
+{{< code file=content/about.md lang=text >}}
{{* myshortcode greeting="Hello" firstName="world" */>}}
{{* myshortcode "Hello" "world" */>}}
{{< /code >}}
diff --git a/content/en/methods/shortcode/Name.md b/content/en/methods/shortcode/Name.md
index fcf92718f..7e55d2df6 100644
--- a/content/en/methods/shortcode/Name.md
+++ b/content/en/methods/shortcode/Name.md
@@ -3,17 +3,18 @@ title: Name
description: Returns the shortcode file name, excluding the file extension.
categories: []
keywords: []
-action:
- related:
- - methods/shortcode/Position
- - functions/fmt/Errorf
- returnType: string
- signatures: [SHORTCODE.Name]
+params:
+ functions_and_methods:
+ related:
+ - methods/shortcode/Position
+ - functions/fmt/Errorf
+ returnType: string
+ signatures: [SHORTCODE.Name]
---
The `Name` method is useful for error reporting. For example, if your shortcode requires a "greeting" argument:
-{{< code file=layouts/shortcodes/myshortcode.html >}}
+{{< code file=layouts/shortcodes/myshortcode.html >}}
{{ $greeting := "" }}
{{ with .Get "greeting" }}
{{ $greeting = . }}
diff --git a/content/en/methods/shortcode/Ordinal.md b/content/en/methods/shortcode/Ordinal.md
index 6e70d134a..fcbea1bab 100644
--- a/content/en/methods/shortcode/Ordinal.md
+++ b/content/en/methods/shortcode/Ordinal.md
@@ -3,21 +3,22 @@ title: Ordinal
description: Returns the zero-based ordinal of the shortcode in relation to its parent.
categories: []
keywords: []
-action:
- related: []
- returnType: int
- signatures: [SHORTCODE.Ordinal]
+params:
+ functions_and_methods:
+ related: []
+ returnType: int
+ signatures: [SHORTCODE.Ordinal]
---
The `Ordinal` method returns the zero-based ordinal of the shortcode in relation to its parent. If the parent is the page itself, the ordinal represents the position of this shortcode in the page content.
{{< note >}}
-Hugo increments the ordinal with each shortcode call, regardless of the specific shortcode type. This means that the ordinal value is tracked sequentially across all shortcodes within a given page.
+Hugo increments the ordinal with each shortcode call, regardless of the specific shortcode type. This means that the ordinal value is tracked sequentially across all shortcodes within a given page.
{{< /note >}}
This method is useful for, among other things, assigning unique element IDs when a shortcode is called two or more times from the same page. For example:
-{{< code file=content/about.md lang=md >}}
+{{< code file=content/about.md lang=text >}}
{{* img src="images/a.jpg" */>}}
{{* img src="images/b.jpg" */>}}
@@ -25,7 +26,7 @@ This method is useful for, among other things, assigning unique element IDs when
This shortcode performs error checking, then renders an HTML `img` element with a unique `id` attribute:
-{{< code file=layouts/shortcodes/img.html >}}
+{{< code file=layouts/shortcodes/img.html >}}
{{ $src := "" }}
{{ with .Get "src" }}
{{ $src = . }}
@@ -48,7 +49,7 @@ Hugo renders the page to:
```
{{< note >}}
-In the shortcode template above, the [`with`] statement is used to create conditional blocks. Remember that the `with` statement binds context (the dot) to its expression. Inside of a `with` block, preface shortcode method calls with a `$` to access the top level context passed into the template.
+In the shortcode template above, the [`with`] statement is used to create conditional blocks. Remember that the `with` statement binds context (the dot) to its expression. Inside of a `with` block, preface shortcode method calls with a `$` to access the top-level context passed into the template.
[`with`]: /functions/go-template/with/
{{< /note >}}
diff --git a/content/en/methods/shortcode/Page.md b/content/en/methods/shortcode/Page.md
index 8bb58fa18..b5ca5d6cd 100644
--- a/content/en/methods/shortcode/Page.md
+++ b/content/en/methods/shortcode/Page.md
@@ -3,10 +3,11 @@ title: Page
description: Returns the Page object from which the shortcode was called.
categories: []
keywords: []
-action:
- related: []
- returnType: hugolib.pageForShortcode
- signatures: [SHORTCODE.Page]
+params:
+ functions_and_methods:
+ related: []
+ returnType: hugolib.pageForShortcode
+ signatures: [SHORTCODE.Page]
---
With this content:
@@ -26,7 +27,7 @@ Calling this shortcode:
We can access the front matter values using the `Page` method:
-{{< code file=layouts/shortcodes/book-details.html >}}
+{{< code file=layouts/shortcodes/book-details.html >}}
- Title: {{ .Page.Title }}
- Author: {{ .Page.Params.author }}
diff --git a/content/en/methods/shortcode/Params.md b/content/en/methods/shortcode/Params.md
index c0772e36a..5a79174d2 100644
--- a/content/en/methods/shortcode/Params.md
+++ b/content/en/methods/shortcode/Params.md
@@ -3,31 +3,32 @@ title: Params
description: Returns a collection of the shortcode arguments.
categories: []
keywords: []
-action:
- related:
- - methods/shortcode/Get
- returnType: any
- signatures: [SHORTCODE.Params]
+params:
+ functions_and_methods:
+ related:
+ - methods/shortcode/Get
+ returnType: any
+ signatures: [SHORTCODE.Params]
---
When you call a shortcode using positional arguments, the `Params` method returns a slice.
-{{< code file=content/about.md lang=md >}}
+{{< code file=content/about.md lang=text >}}
{{* myshortcode "Hello" "world" */>}}
{{< /code >}}
-{{< code file=layouts/shortcodes/myshortcode.html >}}
+{{< code file=layouts/shortcodes/myshortcode.html >}}
{{ index .Params 0 }} → Hello
{{ index .Params 1 }} → world
{{< /code >}}
When you call a shortcode using named arguments, the `Params` method returns a map.
-{{< code file=content/about.md lang=md >}}
+{{< code file=content/about.md lang=text >}}
{{* myshortcode greeting="Hello" name="world" */>}}
{{< /code >}}
-{{< code file=layouts/shortcodes/myshortcode.html >}}
+{{< code file=layouts/shortcodes/myshortcode.html >}}
{{ .Params.greeting }} → Hello
{{ .Params.name }} → world
{{< /code >}}
diff --git a/content/en/methods/shortcode/Parent.md b/content/en/methods/shortcode/Parent.md
index 740b1ad7e..d18bc8139 100644
--- a/content/en/methods/shortcode/Parent.md
+++ b/content/en/methods/shortcode/Parent.md
@@ -1,31 +1,32 @@
---
title: Parent
-description: Returns the parent shortcode context in nested shortcodes.
+description: Returns the parent shortcode context in nested shortcodes.
categories: []
keywords: []
-action:
- related: []
- returnType: hugolib.ShortcodeWithPage
- signatures: [SHORTCODE.Parent]
+params:
+ functions_and_methods:
+ related: []
+ returnType: hugolib.ShortcodeWithPage
+ signatures: [SHORTCODE.Parent]
---
This is useful for inheritance of common shortcode arguments from the root.
In this contrived example, the "greeting" shortcode is the parent, and the "now" shortcode is child.
-{{< code file=content/welcome.md lang=md >}}
+{{< code file=content/welcome.md lang=text >}}
{{* greeting dateFormat="Jan 2, 2006" */>}}
Welcome. Today is {{* now */>}}.
{{* /greeting */>}}
{{< /code >}}
-{{< code file=layouts/shortcodes/greeting.html >}}
+{{< code file=layouts/shortcodes/greeting.html >}}
{{ .Inner | strings.TrimSpace | .Page.RenderString }}
{{< /code >}}
-{{< code file=layouts/shortcodes/now.html >}}
+{{< code file=layouts/shortcodes/now.html >}}
{{- $dateFormat := "January 2, 2006 15:04:05" }}
{{- with .Params }}
diff --git a/content/en/methods/shortcode/Position.md b/content/en/methods/shortcode/Position.md
index e3a60a456..8a2c62efd 100644
--- a/content/en/methods/shortcode/Position.md
+++ b/content/en/methods/shortcode/Position.md
@@ -1,19 +1,20 @@
---
title: Position
-description: Returns the filename and position from which the shortcode was called.
+description: Returns the file name and position from which the shortcode was called.
categories: []
keywords: []
-action:
- related:
- - methods/shortcode/Name
- - functions/fmt/Errorf
- returnType: text.Position
- signatures: [SHORTCODE.Position]
+params:
+ functions_and_methods:
+ related:
+ - methods/shortcode/Name
+ - functions/fmt/Errorf
+ returnType: text.Position
+ signatures: [SHORTCODE.Position]
---
The `Position` method is useful for error reporting. For example, if your shortcode requires a "greeting" argument:
-{{< code file=layouts/shortcodes/myshortcode.html >}}
+{{< code file=layouts/shortcodes/myshortcode.html >}}
{{ $greeting := "" }}
{{ with .Get "greeting" }}
{{ $greeting = . }}
diff --git a/content/en/methods/shortcode/Ref.md b/content/en/methods/shortcode/Ref.md
index 305e1e7d8..84c5678cf 100644
--- a/content/en/methods/shortcode/Ref.md
+++ b/content/en/methods/shortcode/Ref.md
@@ -3,27 +3,28 @@ title: Ref
description: Returns the absolute URL of the page with the given path, language, and output format.
categories: []
keywords: []
-action:
- related:
- - methods/shortcode/RelRef
- - functions/urls/RelRef
- - functions/urls/Ref
- returnType: string
- signatures: [SHORTCODE.Ref OPTIONS]
+params:
+ functions_and_methods:
+ related:
+ - methods/shortcode/RelRef
+ - functions/urls/RelRef
+ - functions/urls/Ref
+ returnType: string
+ signatures: [SHORTCODE.Ref OPTIONS]
---
-The map of option contains:
-path
-: (`string`) The path to the page, relative to the `content` directory. Required.
+## Usage
-lang
-: (`string`) The language (site) to search for the page. Default is the current language. Optional.
+The `Ref` method accepts a single argument: an options map.
-outputFormat
-: (`string`) The output format to search for the page. Default is the current output format. Optional.
+## Options
-The examples below show the rendered output when visiting a page on the English language version of the site:
+{{% include "_common/ref-and-relref-options.md" %}}
+
+## Examples
+
+The following examples show the rendered output for a page on the English version of the site:
```go-html-template
{{ $opts := dict "path" "/books/book-1" }}
@@ -36,9 +37,6 @@ The examples below show the rendered output when visiting a page on the English
{{ .Ref $opts }} → https://example.org/de/books/book-1/index.json
```
-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.
+## Error handling
-{{< code-toggle file=hugo >}}
-refLinksErrorLevel = 'warning'
-refLinksNotFoundURL = '/some/other/url'
-{{< /code-toggle >}}
+{{% include "_common/ref-and-relref-error-handling.md" %}}
diff --git a/content/en/methods/shortcode/RelRef.md b/content/en/methods/shortcode/RelRef.md
index 4e367312b..3186d53d4 100644
--- a/content/en/methods/shortcode/RelRef.md
+++ b/content/en/methods/shortcode/RelRef.md
@@ -3,27 +3,27 @@ title: RelRef
description: Returns the relative URL of the page with the given path, language, and output format.
categories: []
keywords: []
-action:
- related:
- - methods/shortcode/Ref
- - functions/urls/Ref
- - functions/urls/RelRef
- returnType: string
- signatures: [SHORTCODE.RelRef OPTIONS]
+params:
+ functions_and_methods:
+ related:
+ - methods/shortcode/Ref
+ - functions/urls/Ref
+ - functions/urls/RelRef
+ returnType: string
+ signatures: [SHORTCODE.RelRef OPTIONS]
---
-The map of option contains:
+## Usage
-path
-: (`string`) The path to the page, relative to the `content` directory. Required.
+The `RelRef` method accepts a single argument: an options map.
-lang
-: (`string`) The language (site) to search for the page. Default is the current language. Optional.
+## Options
-outputFormat
-: (`string`) The output format to search for the page. Default is the current output format. Optional.
+{{% include "_common/ref-and-relref-options.md" %}}
-The examples below show the rendered output when visiting a page on the English language version of the site:
+## Examples
+
+The following examples show the rendered output for a page on the English version of the site:
```go-html-template
{{ $opts := dict "path" "/books/book-1" }}
@@ -36,9 +36,6 @@ The examples below show the rendered output when visiting a page on the English
{{ .RelRef $opts }} → /de/books/book-1/index.json
```
-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.
+## Error handling
-{{< code-toggle file=hugo >}}
-refLinksErrorLevel = 'warning'
-refLinksNotFoundURL = '/some/other/url'
-{{< /code-toggle >}}
+{{% include "_common/ref-and-relref-error-handling.md" %}}
diff --git a/content/en/methods/shortcode/Scratch.md b/content/en/methods/shortcode/Scratch.md
index c8be53724..49598397b 100644
--- a/content/en/methods/shortcode/Scratch.md
+++ b/content/en/methods/shortcode/Scratch.md
@@ -3,10 +3,11 @@ title: Scratch
description: Returns a "scratch pad" to store and manipulate data, scoped to the current shortcode.
categories: []
keywords: []
-action:
- related: []
- returnType: maps.Scratch
- signatures: [SHORTCODE.Scratch]
+params:
+ functions_and_methods:
+ related: []
+ returnType: maps.Scratch
+ signatures: [SHORTCODE.Scratch]
expiryDate: 2026-11-18 # deprecated 2024-11-18 (soft)
---
diff --git a/content/en/methods/shortcode/Site.md b/content/en/methods/shortcode/Site.md
index af2a755ee..0e9af8d4e 100644
--- a/content/en/methods/shortcode/Site.md
+++ b/content/en/methods/shortcode/Site.md
@@ -3,11 +3,12 @@ title: Site
description: Returns the Site object.
categories: []
keywords: []
-action:
- related:
- - methods/page/Sites
- returnType: page.siteWrapper
- signatures: [SHORTCODE.Site]
+params:
+ functions_and_methods:
+ related:
+ - methods/page/Sites
+ returnType: page.siteWrapper
+ signatures: [SHORTCODE.Site]
---
See [Site methods].
diff --git a/content/en/methods/shortcode/Store.md b/content/en/methods/shortcode/Store.md
index 1517e1f7d..ed4af3456 100644
--- a/content/en/methods/shortcode/Store.md
+++ b/content/en/methods/shortcode/Store.md
@@ -3,15 +3,15 @@ title: Store
description: Returns a "scratch pad" to store and manipulate data, scoped to the current shortcode.
categories: []
keywords: []
-action:
- related:
- - methods/page/Store
- - methods/site/Store
- - functions/hugo/Store
- - functions/collections/NewScratch
- returnType: maps.Scratch
- signatures: [SHORTCODE.Store]
-toc: true
+params:
+ functions_and_methods:
+ related:
+ - methods/page/Store
+ - methods/site/Store
+ - functions/hugo/Store
+ - functions/collections/NewScratch
+ returnType: maps.Scratch
+ signatures: [SHORTCODE.Store]
---
{{< new-in 0.139.0 />}}
@@ -21,7 +21,7 @@ Use the `Store` method to create a [scratch pad](g) to store and manipulate data
{{< note >}}
With the introduction of the [`newScratch`] function, and the ability to [assign values to template variables] after initialization, the `Store` method within a shortcode is mostly obsolete.
-[assign values to template variables]: https://go.dev/doc/go1.11#text/template
+[assign values to template variables]: https://go.dev/doc/go1.11#texttemplatepkgtexttemplate
[`newScratch`]: /functions/collections/newScratch/
{{< /note >}}
diff --git a/content/en/methods/shortcode/_index.md b/content/en/methods/shortcode/_index.md
index 1c99adba7..0064f42aa 100644
--- a/content/en/methods/shortcode/_index.md
+++ b/content/en/methods/shortcode/_index.md
@@ -4,10 +4,5 @@ linkTitle: Shortcode
description: Use these methods in your shortcode templates.
categories: []
keywords: []
-menu:
- docs:
- parent: methods
aliases: [/variables/shortcodes]
---
-
-Use these methods in your shortcode templates.
diff --git a/content/en/methods/site/AllPages.md b/content/en/methods/site/AllPages.md
index 7c6c21b57..5c5240ebe 100644
--- a/content/en/methods/site/AllPages.md
+++ b/content/en/methods/site/AllPages.md
@@ -3,16 +3,17 @@ title: AllPages
description: Returns a collection of all pages in all languages.
categories: []
keywords: []
-action:
- related:
- - methods/site/Pages
- - methods/site/RegularPages
- - methods/site/Sections
- returnType: page.Pages
- signatures: [SITE.AllPages]
+params:
+ functions_and_methods:
+ related:
+ - methods/site/Pages
+ - methods/site/RegularPages
+ - methods/site/Sections
+ returnType: page.Pages
+ signatures: [SITE.AllPages]
---
-This method returns all page [kinds](g) in all languages. That includes the home page, section pages, taxonomy pages, term pages, and regular pages.
+This method returns all page [kinds](g) in all languages, in the [default sort order](g). That includes the home page, section pages, taxonomy pages, term pages, and regular pages.
In most cases you should use the [`RegularPages`] method instead.
diff --git a/content/en/methods/site/BaseURL.md b/content/en/methods/site/BaseURL.md
index 239b19a38..476515823 100644
--- a/content/en/methods/site/BaseURL.md
+++ b/content/en/methods/site/BaseURL.md
@@ -3,14 +3,15 @@ title: BaseURL
description: Returns the base URL as defined in the site configuration.
categories: []
keywords: []
-action:
- related:
- - functions/urls/AbsURL
- - functions/urls/AbsLangURL
- - functions/urls/RelURL
- - functions/urls/RelLangURL
- returnType: string
- signatures: [SITE.BaseURL]
+params:
+ functions_and_methods:
+ related:
+ - functions/urls/AbsURL
+ - functions/urls/AbsLangURL
+ - functions/urls/RelURL
+ - functions/urls/RelLangURL
+ returnType: string
+ signatures: [SITE.BaseURL]
---
Site configuration:
diff --git a/content/en/methods/site/BuildDrafts.md b/content/en/methods/site/BuildDrafts.md
index 0d85c78fd..0cd1f92d0 100644
--- a/content/en/methods/site/BuildDrafts.md
+++ b/content/en/methods/site/BuildDrafts.md
@@ -3,10 +3,11 @@ title: BuildDrafts
description: Reports whether the current build includes draft pages.
categories: []
keywords: []
-action:
- related: []
- returnType: bool
- signatures: [SITE.BuildDrafts]
+params:
+ functions_and_methods:
+ related: []
+ returnType: bool
+ signatures: [SITE.BuildDrafts]
---
By default, draft pages are not published when building a site. You can change this behavior with a command line flag:
diff --git a/content/en/methods/site/Config.md b/content/en/methods/site/Config.md
index 0ff4cddec..03b0125c7 100644
--- a/content/en/methods/site/Config.md
+++ b/content/en/methods/site/Config.md
@@ -3,20 +3,18 @@ title: Config
description: Returns a subset of the site configuration.
categories: []
keywords: []
-action:
- related: []
- returnType: page.SiteConfig
- signatures: [SITE.Config]
-toc: true
+params:
+ functions_and_methods:
+ related: []
+ returnType: page.SiteConfig
+ signatures: [SITE.Config]
---
The `Config` method on a `Site` object provides access to a subset of the site configuration, specifically the `services` and `privacy` keys.
## Services
-These are the default service settings, typically used by Hugo's built-in templates and shortcodes.
-
-{{< code-toggle config=services />}}
+See [configure services](/configuration/services).
For example, to use Hugo's built-in Google Analytics template you must add a [Google tag ID]:
@@ -37,9 +35,7 @@ You must capitalize each identifier as shown above.
## Privacy
-These are the default privacy settings, typically used by Hugo's built-in templates and shortcodes:
-
-{{< code-toggle config=privacy />}}
+See [configure privacy](/configuration/privacy).
For example, to disable usage of the built-in YouTube shortcode:
diff --git a/content/en/methods/site/Copyright.md b/content/en/methods/site/Copyright.md
index e2ae7d2a5..5e8923b6d 100644
--- a/content/en/methods/site/Copyright.md
+++ b/content/en/methods/site/Copyright.md
@@ -1,12 +1,13 @@
---
title: Copyright
-description: Returns the copyright notice as defined in the site configuration.
+description: Returns the copyright notice as defined in the site configuration.
categories: []
keywords: []
-action:
- related: []
- returnType: string
- signatures: [SITE.Copyright]
+params:
+ functions_and_methods:
+ related: []
+ returnType: string
+ signatures: [SITE.Copyright]
---
Site configuration:
diff --git a/content/en/methods/site/Data.md b/content/en/methods/site/Data.md
index 16130fb79..a181fc9e6 100644
--- a/content/en/methods/site/Data.md
+++ b/content/en/methods/site/Data.md
@@ -3,19 +3,20 @@ title: Data
description: Returns a data structure composed from the files in the data directory.
categories: []
keywords: []
-action:
- related:
- - functions/collections/IndexFunction
- - functions/transform/Unmarshal
- - functions/collections/Where
- - functions/collections/Sort
- returnType: map
- signatures: [SITE.Data]
+params:
+ functions_and_methods:
+ related:
+ - functions/collections/IndexFunction
+ - functions/transform/Unmarshal
+ - functions/collections/Where
+ - functions/collections/Sort
+ returnType: map
+ signatures: [SITE.Data]
---
Use the `Data` method on a `Site` object to access data within the `data` directory, or within any directory [mounted] to the `data` directory. Supported data formats include JSON, TOML, YAML, and XML.
-[mounted]: /hugo-modules/configuration/#module-configuration-mounts
+[mounted]: /configuration/module/#mounts
{{< note >}}
Although Hugo can unmarshal CSV files with the [`transform.Unmarshal`] function, do not place CSV files in the `data` directory. You cannot access data within CSV files using this method.
diff --git a/content/en/methods/site/DisqusShortname.md b/content/en/methods/site/DisqusShortname.md
index fac1b4f0b..d2b311519 100644
--- a/content/en/methods/site/DisqusShortname.md
+++ b/content/en/methods/site/DisqusShortname.md
@@ -3,10 +3,11 @@ title: DisqusShortname
description: Returns the Disqus shortname as defined in the site configuration.
categories: []
keywords: []
-action:
- related: []
- returnType: string
- signatures: [SITE.DisqusShortname]
+params:
+ functions_and_methods:
+ related: []
+ returnType: string
+ signatures: [SITE.DisqusShortname]
expiryDate: 2025-10-30 # deprecated 2023-10-30 in v0.120.0
---
diff --git a/content/en/methods/site/GetPage.md b/content/en/methods/site/GetPage.md
index a439a578b..6b27f3dbd 100644
--- a/content/en/methods/site/GetPage.md
+++ b/content/en/methods/site/GetPage.md
@@ -3,12 +3,12 @@ title: GetPage
description: Returns a Page object from the given path.
categories: []
keywords: []
-action:
- related:
- - methods/page/GetPage
- returnType: page.Page
- signatures: [SITE.GetPage PATH]
-toc: true
+params:
+ functions_and_methods:
+ related:
+ - methods/page/GetPage
+ returnType: page.Page
+ signatures: [SITE.GetPage PATH]
---
The `GetPage` method is also available on `Page` objects, allowing you to specify a path relative to the current page. See [details].
diff --git a/content/en/methods/site/GoogleAnalytics.md b/content/en/methods/site/GoogleAnalytics.md
index b0633fab9..0e3ca2aa7 100644
--- a/content/en/methods/site/GoogleAnalytics.md
+++ b/content/en/methods/site/GoogleAnalytics.md
@@ -3,10 +3,11 @@ title: GoogleAnalytics
description: Returns the Google Analytics tracking ID as defined in the site configuration.
categories: []
keywords: []
-action:
- related: []
- returnType: string
- signatures: [SITE.GoogleAnalytics]
+params:
+ functions_and_methods:
+ related: []
+ returnType: string
+ signatures: [SITE.GoogleAnalytics]
expiryDate: 2025-10-30 # deprecated 2023-10-30 in v0.120.0
---
diff --git a/content/en/methods/site/Home.md b/content/en/methods/site/Home.md
index a25491a8e..456dee0b8 100644
--- a/content/en/methods/site/Home.md
+++ b/content/en/methods/site/Home.md
@@ -3,10 +3,11 @@ title: Home
description: Returns the home Page object for the given site.
categories: []
keywords: []
-action:
- related: []
- returnType: page.Page
- signatures: [SITE.Home]
+params:
+ functions_and_methods:
+ related: []
+ returnType: page.Page
+ signatures: [SITE.Home]
---
This method is useful for obtaining a link to the home page.
diff --git a/content/en/methods/site/IsDevelopment.md b/content/en/methods/site/IsDevelopment.md
index 4ca4069a7..4d2d51961 100644
--- a/content/en/methods/site/IsDevelopment.md
+++ b/content/en/methods/site/IsDevelopment.md
@@ -3,10 +3,11 @@ title: IsDevelopment
description: Reports whether the current running environment is “development”.
categories: []
keywords: []
-action:
- related: []
- returnType: bool
- signatures: [SITE.IsDevelopment]
+params:
+ functions_and_methods:
+ related: []
+ returnType: bool
+ signatures: [SITE.IsDevelopment]
expiryDate: 2025-10-30 # deprecated 2023-10-30 in v0.120.0
---
diff --git a/content/en/methods/site/IsMultiLingual.md b/content/en/methods/site/IsMultiLingual.md
index d7b642f8c..185f3f93f 100644
--- a/content/en/methods/site/IsMultiLingual.md
+++ b/content/en/methods/site/IsMultiLingual.md
@@ -3,10 +3,11 @@ title: IsMultiLingual
description: Reports whether there are two or more configured languages.
categories: []
keywords: []
-action:
- related: []
- returnType: bool
- signatures: [SITE.IsMultiLingual]
+params:
+ functions_and_methods:
+ related: []
+ returnType: bool
+ signatures: [SITE.IsMultiLingual]
expiryDate: 2026-03-16 # deprecated 2024-03-16 in 0.124.0
---
diff --git a/content/en/methods/site/IsServer.md b/content/en/methods/site/IsServer.md
index 6d8817847..d8766432e 100644
--- a/content/en/methods/site/IsServer.md
+++ b/content/en/methods/site/IsServer.md
@@ -3,10 +3,11 @@ title: IsServer
description: Reports whether the built-in development server is running.
categories: []
keywords: []
-action:
- related: []
- returnType: bool
- signatures: [SITE.IsServer]
+params:
+ functions_and_methods:
+ related: []
+ returnType: bool
+ signatures: [SITE.IsServer]
expiryDate: 2025-10-30 # deprecated 2023-10-30 in v0.120.0
---
diff --git a/content/en/methods/site/Language.md b/content/en/methods/site/Language.md
index 2400c225a..3ce728318 100644
--- a/content/en/methods/site/Language.md
+++ b/content/en/methods/site/Language.md
@@ -1,14 +1,14 @@
---
title: Language
-description: Returns the language object for the given site.
+description: Returns the language object for the given site.
categories: []
keywords: []
-action:
- related:
- - methods/page/language
- returnType: langs.Language
- signatures: [SITE.Language]
-toc: true
+params:
+ functions_and_methods:
+ related:
+ - methods/page/language
+ returnType: langs.Language
+ signatures: [SITE.Language]
---
The `Language` method on a `Site` object returns the language object for the given site. The language object points to the language definition in the site configuration.
@@ -27,7 +27,7 @@ languageName = 'Deutsch'
weight = 1
{{< /code-toggle >}}
-###### Lang
+### Lang
(`string`) The language tag as defined by [RFC 5646].
@@ -35,7 +35,7 @@ weight = 1
{{ .Site.Language.Lang }} → de
```
-###### LanguageCode
+### LanguageCode
(`string`) The language code from the site configuration. Falls back to `Lang` if not defined.
@@ -43,7 +43,7 @@ weight = 1
{{ .Site.Language.LanguageCode }} → de-DE
```
-###### LanguageDirection
+### LanguageDirection
(`string`) The language direction from the site configuration, either `ltr` or `rtl`.
@@ -51,7 +51,7 @@ weight = 1
{{ .Site.Language.LanguageDirection }} → ltr
```
-###### LanguageName
+### LanguageName
(`string`) The language name from the site configuration.
@@ -59,7 +59,7 @@ weight = 1
{{ .Site.Language.LanguageName }} → Deutsch
```
-###### Weight
+### Weight
(`int`) The language weight from the site configuration which determines its order in the slice of languages returned by the `Languages` method on a `Site` object.
diff --git a/content/en/methods/site/LanguagePrefix.md b/content/en/methods/site/LanguagePrefix.md
index 88808eda0..33b75df76 100644
--- a/content/en/methods/site/LanguagePrefix.md
+++ b/content/en/methods/site/LanguagePrefix.md
@@ -3,12 +3,13 @@ title: LanguagePrefix
description: Returns the URL language prefix, if any, for the given site.
categories: []
keywords: []
-action:
- related:
- - functions/urls/AbsLangURL
- - functions/urls/RelLangURL
- returnType: string
- signatures: [SITE.LanguagePrefix]
+params:
+ functions_and_methods:
+ related:
+ - functions/urls/AbsLangURL
+ - functions/urls/RelLangURL
+ returnType: string
+ signatures: [SITE.LanguagePrefix]
---
Consider this site configuration:
diff --git a/content/en/methods/site/Languages.md b/content/en/methods/site/Languages.md
index cfa1ade6b..3b0f71e81 100644
--- a/content/en/methods/site/Languages.md
+++ b/content/en/methods/site/Languages.md
@@ -3,11 +3,12 @@ title: Languages
description: Returns a collection of language objects for all sites, ordered by language weight.
categories: []
keywords: []
-action:
- related:
- - methods/site/Language
- returnType: langs.Languages
- signatures: [SITE.Languages]
+params:
+ functions_and_methods:
+ related:
+ - methods/site/Language
+ returnType: langs.Languages
+ signatures: [SITE.Languages]
---
The `Languages` method on a `Site` object returns a collection of language objects for all sites, ordered by language weight. Each language object points to its language definition in the site configuration.
diff --git a/content/en/methods/site/LastChange.md b/content/en/methods/site/LastChange.md
index 0110cf855..962223a09 100644
--- a/content/en/methods/site/LastChange.md
+++ b/content/en/methods/site/LastChange.md
@@ -3,10 +3,11 @@ title: LastChange
description: Returns the last modification date of site content.
categories: []
keywords: []
-action:
- related: []
- returnType: time.Time
- signatures: [SITE.LastChange]
+params:
+ functions_and_methods:
+ related: []
+ returnType: time.Time
+ signatures: [SITE.LastChange]
expiryDate: 2026-02-19 # deprecated 2024-02-19 in v0.123.0
---
diff --git a/content/en/methods/site/Lastmod.md b/content/en/methods/site/Lastmod.md
index f1663db49..7aa828abd 100644
--- a/content/en/methods/site/Lastmod.md
+++ b/content/en/methods/site/Lastmod.md
@@ -3,10 +3,11 @@ title: Lastmod
description: Returns the last modification date of site content.
categories: []
keywords: []
-action:
- related: []
- returnType: time.Time
- signatures: [SITE.Lastmod]
+params:
+ functions_and_methods:
+ related: []
+ returnType: time.Time
+ signatures: [SITE.Lastmod]
---
{{< new-in 0.123.0 />}}
diff --git a/content/en/methods/site/MainSections.md b/content/en/methods/site/MainSections.md
index aa6e84bda..a415e4ded 100644
--- a/content/en/methods/site/MainSections.md
+++ b/content/en/methods/site/MainSections.md
@@ -1,18 +1,18 @@
---
title: MainSections
-description: Returns a slice of the main section names as defined in the site configuration, falling back to the top level section with the most pages.
+description: Returns a slice of the main section names as defined in the site configuration, falling back to the top-level section with the most pages.
categories: []
keywords: []
-action:
- related: []
- returnType: '[]string'
- signatures: [SITE.MainSections]
+params:
+ functions_and_methods:
+ related: []
+ returnType: '[]string'
+ signatures: [SITE.MainSections]
---
Site configuration:
{{< code-toggle file=hugo >}}
-[params]
mainSections = ['books','films']
{{< /code-toggle >}}
@@ -22,7 +22,7 @@ Template:
{{ .Site.MainSections }} → [books films]
```
-If `params.mainSections` is not defined in the site configuration, this method returns a slice with one element---the top level section with the most pages.
+If `mainSections` is not defined in the site configuration, this method returns a slice with one element---the top-level section with the most pages.
With this content structure, the "films" section has the most pages:
@@ -44,7 +44,7 @@ Template:
{{ .Site.MainSections }} → [films]
```
-When creating a theme, instead of hardcoding section names when listing the most relevant pages on the front page, instruct site authors to set `params.mainSections` in their site configuration.
+When creating a theme, instead of hardcoding section names when listing the most relevant pages on the front page, instruct site authors to set `mainSections` in their site configuration.
Then your home template can do something like this:
diff --git a/content/en/methods/site/Menus.md b/content/en/methods/site/Menus.md
index 896d552e3..7e43ca588 100644
--- a/content/en/methods/site/Menus.md
+++ b/content/en/methods/site/Menus.md
@@ -3,12 +3,13 @@ title: Menus
description: Returns a collection of menu objects for the given site.
categories: []
keywords: []
-action:
- related:
- - methods/page/IsMenuCurrent
- - methods/page/HasMenuCurrent
- returnType: navigation.Menus
- signatures: [SITE.Menus]
+params:
+ functions_and_methods:
+ related:
+ - methods/page/IsMenuCurrent
+ - methods/page/HasMenuCurrent
+ returnType: navigation.Menus
+ signatures: [SITE.Menus]
---
The `Menus` method on a `Site` object returns a collection of menus, where each menu contains one or more entries, either flat or nested. Each entry points to a page within the site, or to an external resource.
diff --git a/content/en/methods/site/Pages.md b/content/en/methods/site/Pages.md
index bb684a96d..1ced7834d 100644
--- a/content/en/methods/site/Pages.md
+++ b/content/en/methods/site/Pages.md
@@ -3,16 +3,19 @@ title: Pages
description: Returns a collection of all pages.
categories: []
keywords: []
-action:
- related:
- - methods/site/AllPages
- - methods/site/RegularPages
- - methods/site/Sections
- returnType: page.Pages
- signatures: [SITE.Pages]
+params:
+ functions_and_methods:
+ related:
+ - methods/site/AllPages
+ - methods/site/RegularPages
+ - methods/site/Sections
+ returnType: page.Pages
+ signatures: [SITE.Pages]
---
-This method returns all page [kinds](g) in the current language. That includes the home page, section pages, taxonomy pages, term pages, and regular pages.
+This method returns all page [kinds](g) in the current language, in the [default sort order](g). That includes the home page, section pages, taxonomy pages, term pages, and regular pages.
+
+
In most cases you should use the [`RegularPages`] method instead.
diff --git a/content/en/methods/site/Param.md b/content/en/methods/site/Param.md
index 0c2f621c8..ffc663ff7 100644
--- a/content/en/methods/site/Param.md
+++ b/content/en/methods/site/Param.md
@@ -3,10 +3,11 @@ title: Param
description: Returns the site parameter with the given key.
categories: []
keywords: []
-action:
- related: []
- returnType: any
- signatures: [SITE.Param KEY]
+params:
+ functions_and_methods:
+ related: []
+ returnType: any
+ signatures: [SITE.Param KEY]
---
The `Param` method on a `Site` object is a convenience method to return the value of a user-defined parameter in the site configuration.
diff --git a/content/en/methods/site/Params.md b/content/en/methods/site/Params.md
index 418118ee3..40b344d43 100644
--- a/content/en/methods/site/Params.md
+++ b/content/en/methods/site/Params.md
@@ -3,13 +3,14 @@ title: Params
description: Returns a map of custom parameters as defined in the site configuration.
categories: []
keywords: []
-action:
- related:
- - functions/collections/indexFunction
- - methods/page/Params
- - methods/page/Param
- returnType: maps.Params
- signatures: [SITE.Params]
+params:
+ functions_and_methods:
+ related:
+ - functions/collections/indexFunction
+ - methods/page/Params
+ - methods/page/Param
+ returnType: maps.Params
+ signatures: [SITE.Params]
---
With this site configuration:
diff --git a/content/en/methods/site/RegularPages.md b/content/en/methods/site/RegularPages.md
index 65bafef6c..b13cb82dd 100644
--- a/content/en/methods/site/RegularPages.md
+++ b/content/en/methods/site/RegularPages.md
@@ -3,16 +3,17 @@ title: RegularPages
description: Returns a collection of all regular pages.
categories: []
keywords: []
-action:
- related:
- - methods/site/AllPages
- - methods/site/RegularPages
- - methods/site/Sections
- returnType: page.Pages
- signatures: [SITE.RegularPages]
+params:
+ functions_and_methods:
+ related:
+ - methods/site/AllPages
+ - methods/site/RegularPages
+ - methods/site/Sections
+ returnType: page.Pages
+ signatures: [SITE.RegularPages]
---
-The `RegularPages` method on a `Site` object returns a collection of all [regular pages](g).
+The `RegularPages` method on a `Site` object returns a collection of all [regular pages](g), in the [default sort order](g).
```go-html-template
{{ range .Site.RegularPages }}
@@ -20,14 +21,9 @@ The `RegularPages` method on a `Site` object returns a collection of all [regula
{{ end }}
```
-By default, Hugo sorts page collections by:
+{{% glossary-term "default sort order" %}}
-1. The page `weight` as defined in front matter
-1. The page `date` as defined in front matter
-1. The page `linkTitle` as defined in front matter
-1. The file path
-
-If the `linkTitle` is not defined, Hugo evaluates the `title` instead.
+[default sort order](g)
To change the sort order, use any of the `Pages` [sorting methods]. For example:
diff --git a/content/en/methods/site/Sections.md b/content/en/methods/site/Sections.md
index a397c5926..751e71044 100644
--- a/content/en/methods/site/Sections.md
+++ b/content/en/methods/site/Sections.md
@@ -1,17 +1,20 @@
---
title: Sections
-description: Returns a collection of first level section pages.
+description: Returns a collection of top-level section pages.
categories: []
keywords: []
-action:
- related:
- - methods/site/AllPages
- - methods/site/Pages
- - methods/site/RegularPages
- returnType: page.Pages
- signatures: [SITE.Sections]
+params:
+ functions_and_methods:
+ related:
+ - methods/site/AllPages
+ - methods/site/Pages
+ - methods/site/RegularPages
+ returnType: page.Pages
+ signatures: [SITE.Sections]
---
+The `Sections` method on a `Site` object returns a collection of top-level [section pages](g), in the [default sort order](g).
+
Given this content structure:
```text
diff --git a/content/en/methods/site/Sites.md b/content/en/methods/site/Sites.md
index ac287d3b4..096805f47 100644
--- a/content/en/methods/site/Sites.md
+++ b/content/en/methods/site/Sites.md
@@ -3,10 +3,11 @@ title: Sites
description: Returns a collection of all Site objects, one for each language, ordered by default content language then by language weight.
categories: []
keywords: []
-action:
- related: []
- returnType: page.Sites
- signatures: [SITE.Sites]
+params:
+ functions_and_methods:
+ related: []
+ returnType: page.Sites
+ signatures: [SITE.Sites]
---
With this site configuration:
diff --git a/content/en/methods/site/Store.md b/content/en/methods/site/Store.md
index dcc3a0bed..02e3b27d9 100644
--- a/content/en/methods/site/Store.md
+++ b/content/en/methods/site/Store.md
@@ -3,14 +3,14 @@ title: Store
description: Returns a "scratch pad" to store and manipulate data, scoped to the current site.
categories: []
keywords: []
-action:
- related:
- - methods/page/store
- - functions/hugo/store
- - functions/collections/NewScratch
- returnType: maps.Scratch
- signatures: [site.Store]
-toc: true
+params:
+ functions_and_methods:
+ related:
+ - methods/page/store
+ - functions/hugo/store
+ - functions/collections/NewScratch
+ returnType: maps.Scratch
+ signatures: [site.Store]
---
{{< new-in 0.139.0 />}}
@@ -19,7 +19,7 @@ Use the `Store` method on a `Site` object to create a [scratch pad](g) to store
## Methods
-###### Set
+### Set
Sets the value of a given key.
@@ -27,7 +27,7 @@ Sets the value of a given key.
{{ site.Store.Set "greeting" "Hello" }}
```
-###### Get
+### Get
Gets the value of a given key.
@@ -36,7 +36,7 @@ Gets the value of a given key.
{{ site.Store.Get "greeting" }} → Hello
```
-###### Add
+### Add
Adds a given value to existing value(s) of the given key.
@@ -58,9 +58,9 @@ For single values, `Add` accepts values that support Go's `+` operator. If the f
{{ site.Store.Set "greetings" (slice "Hello") }}
{{ site.Store.Add "greetings" (slice "Welcome" "Cheers") }}
{{ site.Store.Get "greetings" }} → [Hello Welcome Cheers]
-```
+ ```
-###### SetInMap
+### SetInMap
Takes a `key`, `mapKey` and `value` and adds a map of `mapKey` and `value` to the given `key`.
@@ -70,7 +70,7 @@ Takes a `key`, `mapKey` and `value` and adds a map of `mapKey` and `value` to th
{{ site.Store.Get "greetings" }} → map[english:Hello french:Bonjour]
```
-###### DeleteInMap
+### DeleteInMap
Takes a `key` and `mapKey` and removes the map of `mapKey` from the given `key`.
@@ -81,7 +81,7 @@ Takes a `key` and `mapKey` and removes the map of `mapKey` from the given `key`.
{{ site.Store.Get "greetings" }} → map[french:Bonjour]
```
-###### GetSortedMapValues
+### GetSortedMapValues
Returns an array of values from `key` sorted by `mapKey`.
@@ -91,7 +91,7 @@ Returns an array of values from `key` sorted by `mapKey`.
{{ site.Store.GetSortedMapValues "greetings" }} → [Hello Bonjour]
```
-###### Delete
+### Delete
Removes the given key.
diff --git a/content/en/methods/site/Taxonomies.md b/content/en/methods/site/Taxonomies.md
index cad665d0d..5b69efff3 100644
--- a/content/en/methods/site/Taxonomies.md
+++ b/content/en/methods/site/Taxonomies.md
@@ -3,15 +3,16 @@ title: Taxonomies
description: Returns a data structure containing the site's Taxonomy objects, the terms within each Taxonomy object, and the pages to which the terms are assigned.
categories: []
keywords: []
-action:
- related: []
- returnType: page.TaxonomyList
- signatures: [SITE.Taxonomies]
+params:
+ functions_and_methods:
+ related: []
+ returnType: page.TaxonomyList
+ signatures: [SITE.Taxonomies]
---
Conceptually, the `Taxonomies` method on a `Site` object returns a data structure such as:
-{{< code-toggle >}}
+{{< code-toggle file=hugo >}}
taxonomy a:
- term 1:
- page 1
@@ -50,7 +51,7 @@ content/
Conceptually, the taxonomies data structure looks like:
-{{< code-toggle >}}
+{{< code-toggle file=hugo >}}
genres:
- suspense:
- And Then There Were None
diff --git a/content/en/methods/site/Title.md b/content/en/methods/site/Title.md
index a357286c1..e157f62ea 100644
--- a/content/en/methods/site/Title.md
+++ b/content/en/methods/site/Title.md
@@ -3,10 +3,11 @@ title: Title
description: Returns the title as defined in the site configuration.
categories: []
keywords: []
-action:
- related: []
- returnType: string
- signatures: [SITE.Title]
+params:
+ functions_and_methods:
+ related: []
+ returnType: string
+ signatures: [SITE.Title]
---
Site configuration:
diff --git a/content/en/methods/site/_index.md b/content/en/methods/site/_index.md
index bf322ee07..f395a3693 100644
--- a/content/en/methods/site/_index.md
+++ b/content/en/methods/site/_index.md
@@ -4,10 +4,5 @@ linkTitle: Site
description: Use these methods with Site objects.
categories: []
keywords: []
-menu:
- docs:
- parent: methods
aliases: [/variables/site/]
---
-
-Use these methods with Site objects. A multilingual project will have two or more sites, one for each language.
diff --git a/content/en/methods/taxonomy/Alphabetical.md b/content/en/methods/taxonomy/Alphabetical.md
index 72cd1c355..35fafac43 100644
--- a/content/en/methods/taxonomy/Alphabetical.md
+++ b/content/en/methods/taxonomy/Alphabetical.md
@@ -3,23 +3,23 @@ title: Alphabetical
description: Returns an ordered taxonomy, sorted alphabetically by term.
categories: []
keywords: []
-action:
- related:
- - methods/taxonomy/ByCount
- returnType: page.OrderedTaxonomy
- signatures: [TAXONOMY.Alphabetical]
-toc: true
+params:
+ functions_and_methods:
+ related:
+ - methods/taxonomy/ByCount
+ returnType: page.OrderedTaxonomy
+ signatures: [TAXONOMY.Alphabetical]
---
The `Alphabetical` method on a `Taxonomy` object returns an [ordered taxonomy](g), sorted alphabetically by [term](g).
While a `Taxonomy` object is a [map](g), an ordered taxonomy is a [slice](g), where each element is an object that contains the term and a slice of its [weighted pages](g).
-{{% include "methods/taxonomy/_common/get-a-taxonomy-object.md" %}}
+{{% include "/_common/methods/taxonomy/get-a-taxonomy-object.md" %}}
## Get the ordered taxonomy
-Now that we have captured the “genres” Taxonomy object, let’s get the ordered taxonomy sorted alphabetically by term:
+Now that we have captured the “genres” Taxonomy object, let's get the ordered taxonomy sorted alphabetically by term:
```go-html-template
{{ $taxonomyObject.Alphabetical }}
@@ -37,7 +37,7 @@ To inspect the data structure:
{{ debug.Dump $taxonomyObject.Alphabetical }}
```
-{{% include "methods/taxonomy/_common/ordered-taxonomy-element-methods.md" %}}
+{{% include "/_common/methods/taxonomy/ordered-taxonomy-element-methods.md" %}}
## Example
diff --git a/content/en/methods/taxonomy/ByCount.md b/content/en/methods/taxonomy/ByCount.md
index 930f8953b..7f576953c 100644
--- a/content/en/methods/taxonomy/ByCount.md
+++ b/content/en/methods/taxonomy/ByCount.md
@@ -3,23 +3,23 @@ title: ByCount
description: Returns an ordered taxonomy, sorted by the number of pages associated with each term.
categories: []
keywords: []
-action:
- related:
- - methods/taxonomy/Alphabetical
- returnType: page.OrderedTaxonomy
- signatures: [TAXONOMY.ByCount]
-toc: true
+params:
+ functions_and_methods:
+ related:
+ - methods/taxonomy/Alphabetical
+ returnType: page.OrderedTaxonomy
+ signatures: [TAXONOMY.ByCount]
---
The `ByCount` method on a `Taxonomy` object returns an [ordered taxonomy](g), sorted by the number of pages associated with each [term](g).
While a `Taxonomy` object is a [map](g), an ordered taxonomy is a [slice](g), where each element is an object that contains the term and a slice of its [weighted pages](g).
-{{% include "methods/taxonomy/_common/get-a-taxonomy-object.md" %}}
+{{% include "/_common/methods/taxonomy/get-a-taxonomy-object.md" %}}
## Get the ordered taxonomy
-Now that we have captured the “genres” Taxonomy object, let’s get the ordered taxonomy sorted by the number of pages associated with each term:
+Now that we have captured the “genres” Taxonomy object, let's get the ordered taxonomy sorted by the number of pages associated with each term:
```go-html-template
{{ $taxonomyObject.ByCount }}
@@ -37,7 +37,7 @@ To inspect the data structure:
{{ debug.Dump $taxonomyObject.ByCount }}
```
-{{% include "methods/taxonomy/_common/ordered-taxonomy-element-methods.md" %}}
+{{% include "/_common/methods/taxonomy/ordered-taxonomy-element-methods.md" %}}
## Example
diff --git a/content/en/methods/taxonomy/Count.md b/content/en/methods/taxonomy/Count.md
index 4b756f254..78de79779 100644
--- a/content/en/methods/taxonomy/Count.md
+++ b/content/en/methods/taxonomy/Count.md
@@ -3,16 +3,16 @@ title: Count
description: Returns the number of number of weighted pages to which the given term has been assigned.
categories: []
keywords: []
-action:
- related: []
- returnType: int
- signatures: [TAXONOMY.Count TERM]
-toc: true
+params:
+ functions_and_methods:
+ related: []
+ returnType: int
+ signatures: [TAXONOMY.Count TERM]
---
The `Count` method on a `Taxonomy` object returns the number of number of [weighted pages](g) to which the given [term](g) has been assigned.
-{{% include "methods/taxonomy/_common/get-a-taxonomy-object.md" %}}
+{{% include "/_common/methods/taxonomy/get-a-taxonomy-object.md" %}}
## Count the weighted pages
diff --git a/content/en/methods/taxonomy/Get.md b/content/en/methods/taxonomy/Get.md
index 107912493..41c2d6645 100644
--- a/content/en/methods/taxonomy/Get.md
+++ b/content/en/methods/taxonomy/Get.md
@@ -3,16 +3,16 @@ title: Get
description: Returns a slice of weighted pages to which the given term has been assigned.
categories: []
keywords: []
-action:
- related: []
- returnType: page.WeightedPages
- signatures: [TAXONOMY.Get TERM]
-toc: true
+params:
+ functions_and_methods:
+ related: []
+ returnType: page.WeightedPages
+ signatures: [TAXONOMY.Get TERM]
---
The `Get` method on a `Taxonomy` object returns a slice of [weighted pages](g) to which the given [term](g) has been assigned.
-{{% include "methods/taxonomy/_common/get-a-taxonomy-object.md" %}}
+{{% include "/_common/methods/taxonomy/get-a-taxonomy-object.md" %}}
## Get the weighted pages
diff --git a/content/en/methods/taxonomy/Page.md b/content/en/methods/taxonomy/Page.md
index 039719b93..9fcc4853c 100644
--- a/content/en/methods/taxonomy/Page.md
+++ b/content/en/methods/taxonomy/Page.md
@@ -3,10 +3,11 @@ title: Page
description: Returns the taxonomy page or nil if the taxonomy has no terms.
categories: []
keywords: []
-action:
- related: []
- returnType: page.Page
- signatures: [TAXONOMY.Page]
+params:
+ functions_and_methods:
+ related: []
+ returnType: page.Page
+ signatures: [TAXONOMY.Page]
---
{{< new-in 0.125.0 />}}
diff --git a/content/en/methods/taxonomy/_common/_index.md b/content/en/methods/taxonomy/_common/_index.md
deleted file mode 100644
index 4328d4d14..000000000
--- a/content/en/methods/taxonomy/_common/_index.md
+++ /dev/null
@@ -1,13 +0,0 @@
----
-cascade:
- _build:
- list: never
- publishResources: false
- render: never
----
-
-
diff --git a/content/en/methods/taxonomy/_index.md b/content/en/methods/taxonomy/_index.md
index 18c7f12c9..13acdb10c 100644
--- a/content/en/methods/taxonomy/_index.md
+++ b/content/en/methods/taxonomy/_index.md
@@ -3,11 +3,5 @@ title: Taxonomy methods
linkTitle: Taxonomy
description: Use these methods with Taxonomy objects.
keywords: []
-menu:
- docs:
- identifier:
- parent: methods
aliases: [/variables/taxonomy/]
---
-
-Use these methods with Taxonomy objects.
diff --git a/content/en/methods/time/Add.md b/content/en/methods/time/Add.md
index 8fd755244..10aa54951 100644
--- a/content/en/methods/time/Add.md
+++ b/content/en/methods/time/Add.md
@@ -3,13 +3,14 @@ title: Add
description: Returns the given time plus the given duration.
categories: []
keywords: []
-action:
- related:
- - functions/time/AsTime
- - functions/time/Duration
- - functions/time/ParseDuration
- returnType: time.Time
- signatures: [TIME.Add DURATION]
+params:
+ functions_and_methods:
+ related:
+ - functions/time/AsTime
+ - functions/time/Duration
+ - functions/time/ParseDuration
+ returnType: time.Time
+ signatures: [TIME.Add DURATION]
---
```go-html-template
diff --git a/content/en/methods/time/AddDate.md b/content/en/methods/time/AddDate.md
index a4ef482ed..c7d534ecd 100644
--- a/content/en/methods/time/AddDate.md
+++ b/content/en/methods/time/AddDate.md
@@ -3,11 +3,11 @@ title: AddDate
description: Returns the time corresponding to adding the given number of years, months, and days to the given time.Time value.
categories: []
keywords: []
-action:
- aliases: []
- related: []
- returnType: time.Time
- signatures: [TIME.AddDate YEARS MONTHS DAYS]
+params:
+ functions_and_methods:
+ related: []
+ returnType: time.Time
+ signatures: [TIME.AddDate YEARS MONTHS DAYS]
aliases: [/functions/adddate]
---
diff --git a/content/en/methods/time/After.md b/content/en/methods/time/After.md
index 64c6cfe67..866d5dfc7 100644
--- a/content/en/methods/time/After.md
+++ b/content/en/methods/time/After.md
@@ -3,13 +3,14 @@ title: After
description: Reports whether TIME1 is after TIME2.
categories: []
keywords: []
-action:
- related:
- - methods/time/Before
- - methods/time/Equal
- - functions/time/AsTime
- returnType: bool
- signatures: [TIME1.After TIME2]
+params:
+ functions_and_methods:
+ related:
+ - methods/time/Before
+ - methods/time/Equal
+ - functions/time/AsTime
+ returnType: bool
+ signatures: [TIME1.After TIME2]
---
```go-html-template
diff --git a/content/en/methods/time/Before.md b/content/en/methods/time/Before.md
index c3d582860..2290b88d7 100644
--- a/content/en/methods/time/Before.md
+++ b/content/en/methods/time/Before.md
@@ -3,13 +3,14 @@ title: Before
description: Reports whether TIME1 is before TIME2.
categories: []
keywords: []
-action:
- related:
- - methods/time/After
- - methods/time/Equal
- - functions/time/AsTime
- returnType: bool
- signatures: [TIME1.Before TIME2]
+params:
+ functions_and_methods:
+ related:
+ - methods/time/After
+ - methods/time/Equal
+ - functions/time/AsTime
+ returnType: bool
+ signatures: [TIME1.Before TIME2]
---
```go-html-template
diff --git a/content/en/methods/time/Day.md b/content/en/methods/time/Day.md
index 1173b8489..4488b1505 100644
--- a/content/en/methods/time/Day.md
+++ b/content/en/methods/time/Day.md
@@ -3,16 +3,17 @@ title: Day
description: Returns the day of the month of the given time.Time value.
categories: []
keywords: []
-action:
- related:
- - methods/time/Year
- - methods/time/Month
- - methods/time/Hour
- - methods/time/Minute
- - methods/time/Second
- - functions/time/AsTime
- returnType: int
- signatures: [TIME.Day]
+params:
+ functions_and_methods:
+ related:
+ - methods/time/Year
+ - methods/time/Month
+ - methods/time/Hour
+ - methods/time/Minute
+ - methods/time/Second
+ - functions/time/AsTime
+ returnType: int
+ signatures: [TIME.Day]
---
```go-html-template
diff --git a/content/en/methods/time/Equal.md b/content/en/methods/time/Equal.md
index 4d45a3ada..e4dd33b6a 100644
--- a/content/en/methods/time/Equal.md
+++ b/content/en/methods/time/Equal.md
@@ -3,13 +3,14 @@ title: Equal
description: Reports whether TIME1 is equal to TIME2.
categories: []
keywords: []
-action:
- related:
- - methods/time/After
- - methods/time/Before
- - functions/time/AsTime
- returnType: bool
- signatures: [TIME1.Equal TIME2]
+params:
+ functions_and_methods:
+ related:
+ - methods/time/After
+ - methods/time/Before
+ - functions/time/AsTime
+ returnType: bool
+ signatures: [TIME1.Equal TIME2]
---
```go-html-template
diff --git a/content/en/methods/time/Format.md b/content/en/methods/time/Format.md
index 928af0ee7..b3b290a47 100644
--- a/content/en/methods/time/Format.md
+++ b/content/en/methods/time/Format.md
@@ -3,15 +3,14 @@ title: Format
description: Returns a textual representation of the time.Time value formatted according to the layout string.
categories: []
keywords: []
-action:
- aliases: []
- related:
- - functions/time/AsTime
- - methods/time/UTC
- - methods/time/Local
- returnType: string
- signatures: [TIME.Format LAYOUT]
-toc: true
+params:
+ functions_and_methods:
+ related:
+ - functions/time/AsTime
+ - methods/time/UTC
+ - methods/time/Local
+ returnType: string
+ signatures: [TIME.Format LAYOUT]
aliases: [/methods/time/format]
---
@@ -48,7 +47,7 @@ Use the [`time.Format`] function to format string representations of dates, and
## Layout string
-{{% include "functions/_common/time-layout-string.md" %}}
+{{% include "/_common/time-layout-string.md" %}}
## Examples
diff --git a/content/en/methods/time/Hour.md b/content/en/methods/time/Hour.md
index 58ed00260..2e6b122be 100644
--- a/content/en/methods/time/Hour.md
+++ b/content/en/methods/time/Hour.md
@@ -3,16 +3,17 @@ title: Hour
description: Returns the hour within the day of the given time.Time value, in the range [0, 23].
categories: []
keywords: []
-action:
- related:
- - methods/time/Year
- - methods/time/Month
- - methods/time/Day
- - methods/time/Minute
- - methods/time/Second
- - functions/time/AsTime
- returnType: int
- signatures: [TIME.Hour]
+params:
+ functions_and_methods:
+ related:
+ - methods/time/Year
+ - methods/time/Month
+ - methods/time/Day
+ - methods/time/Minute
+ - methods/time/Second
+ - functions/time/AsTime
+ returnType: int
+ signatures: [TIME.Hour]
---
```go-html-template
diff --git a/content/en/methods/time/IsDST.md b/content/en/methods/time/IsDST.md
index df2b84cae..37985bf13 100644
--- a/content/en/methods/time/IsDST.md
+++ b/content/en/methods/time/IsDST.md
@@ -3,11 +3,12 @@ title: IsDST
description: Reports whether the given time.Time value is in Daylight Savings Time.
categories: []
keywords: []
-action:
- related:
- - functions/time/AsTime
- returnType: bool
- signatures: [TIME.IsDST]
+params:
+ functions_and_methods:
+ related:
+ - functions/time/AsTime
+ returnType: bool
+ signatures: [TIME.IsDST]
---
```go-html-template
diff --git a/content/en/methods/time/IsZero.md b/content/en/methods/time/IsZero.md
index 2026f3b2e..c447b94cf 100644
--- a/content/en/methods/time/IsZero.md
+++ b/content/en/methods/time/IsZero.md
@@ -3,11 +3,12 @@ title: IsZero
description: Reports whether the given time.Time value represents the zero time instant, January 1, year 1, 00:00:00 UTC.
categories: []
keywords: []
-action:
- related:
- - functions/time/AsTime
- returnType: bool
- signatures: [TIME.IsZero]
+params:
+ functions_and_methods:
+ related:
+ - functions/time/AsTime
+ returnType: bool
+ signatures: [TIME.IsZero]
---
````go-html-template
diff --git a/content/en/methods/time/Local.md b/content/en/methods/time/Local.md
index bd40e3a44..ec50a1eb6 100644
--- a/content/en/methods/time/Local.md
+++ b/content/en/methods/time/Local.md
@@ -3,12 +3,13 @@ title: Local
description: Returns the given time.Time value with the location set to local time.
categories: []
keywords: []
-action:
- related:
- - methods/time/UTC
- - functions/time/AsTime
- returnType: time.Time
- signatures: [TIME.Local]
+params:
+ functions_and_methods:
+ related:
+ - methods/time/UTC
+ - functions/time/AsTime
+ returnType: time.Time
+ signatures: [TIME.Local]
---
```go-html-template
diff --git a/content/en/methods/time/Minute.md b/content/en/methods/time/Minute.md
index d482fab5d..5af1fe26a 100644
--- a/content/en/methods/time/Minute.md
+++ b/content/en/methods/time/Minute.md
@@ -3,16 +3,17 @@ title: Minute
description: Returns the minute offset within the hour of the given time.Time value, in the range [0, 59].
categories: []
keywords: []
-action:
- related:
- - methods/time/Year
- - methods/time/Month
- - methods/time/Day
- - methods/time/Hour
- - methods/time/Second
- - functions/time/AsTime
- returnType: int
- signatures: [TIME.Minute]
+params:
+ functions_and_methods:
+ related:
+ - methods/time/Year
+ - methods/time/Month
+ - methods/time/Day
+ - methods/time/Hour
+ - methods/time/Second
+ - functions/time/AsTime
+ returnType: int
+ signatures: [TIME.Minute]
---
```go-html-template
diff --git a/content/en/methods/time/Month.md b/content/en/methods/time/Month.md
index 0a01d1a70..36d56bf30 100644
--- a/content/en/methods/time/Month.md
+++ b/content/en/methods/time/Month.md
@@ -3,16 +3,17 @@ title: Month
description: Returns the month of the year of the given time.Time value.
categories: []
keywords: []
-action:
- related:
- - methods/time/Year
- - methods/time/Day
- - methods/time/Hour
- - methods/time/Minute
- - methods/time/Second
- - functions/time/AsTime
- returnType: time.Month
- signatures: [TIME.Month]
+params:
+ functions_and_methods:
+ related:
+ - methods/time/Year
+ - methods/time/Day
+ - methods/time/Hour
+ - methods/time/Minute
+ - methods/time/Second
+ - functions/time/AsTime
+ returnType: time.Month
+ signatures: [TIME.Month]
---
To convert the `time.Month` value to a string:
diff --git a/content/en/methods/time/Nanosecond.md b/content/en/methods/time/Nanosecond.md
index 606143139..5adacfa1c 100644
--- a/content/en/methods/time/Nanosecond.md
+++ b/content/en/methods/time/Nanosecond.md
@@ -3,11 +3,12 @@ title: Nanosecond
description: Returns the nanosecond offset within the second of the given time.Time value, in the range [0, 999999999].
categories: []
keywords: []
-action:
- related:
- - functions/time/AsTime
- returnType: int
- signatures: [TIME.Nanosecond]
+params:
+ functions_and_methods:
+ related:
+ - functions/time/AsTime
+ returnType: int
+ signatures: [TIME.Nanosecond]
---
```go-html-template
diff --git a/content/en/methods/time/Round.md b/content/en/methods/time/Round.md
index 16bd2009f..38646faa2 100644
--- a/content/en/methods/time/Round.md
+++ b/content/en/methods/time/Round.md
@@ -3,13 +3,14 @@ title: Round
description: Returns the result of rounding TIME to the nearest multiple of DURATION since January 1, 0001, 00:00:00 UTC.
categories: []
keywords: []
-action:
- related:
- - functions/time/AsTime
- - functions/time/ParseDuration
- - methods/time/Truncate
- returnType: time.Time
- signatures: [TIME.Round DURATION]
+params:
+ functions_and_methods:
+ related:
+ - functions/time/AsTime
+ - functions/time/ParseDuration
+ - methods/time/Truncate
+ returnType: time.Time
+ signatures: [TIME.Round DURATION]
---
The rounding behavior for halfway values is to round up.
diff --git a/content/en/methods/time/Second.md b/content/en/methods/time/Second.md
index e326c64bc..dffa2c0a1 100644
--- a/content/en/methods/time/Second.md
+++ b/content/en/methods/time/Second.md
@@ -3,16 +3,17 @@ title: Second
description: Returns the second offset within the minute of the given time.Time value, in the range [0, 59].
categories: []
keywords: []
-action:
- related:
- - methods/time/Year
- - methods/time/Month
- - methods/time/Day
- - methods/time/Hour
- - methods/time/Minute
- - functions/time/AsTime
- returnType: int
- signatures: [TIME.Second]
+params:
+ functions_and_methods:
+ related:
+ - methods/time/Year
+ - methods/time/Month
+ - methods/time/Day
+ - methods/time/Hour
+ - methods/time/Minute
+ - functions/time/AsTime
+ returnType: int
+ signatures: [TIME.Second]
---
```go-html-template
diff --git a/content/en/methods/time/Sub.md b/content/en/methods/time/Sub.md
index 9678365eb..404ad5623 100644
--- a/content/en/methods/time/Sub.md
+++ b/content/en/methods/time/Sub.md
@@ -3,11 +3,12 @@ title: Sub
description: Returns the duration computed by subtracting TIME2 from TIME1.
categories: []
keywords: []
-action:
- related:
- - functions/time/AsTime
- returnType: time.Duration
- signatures: [TIME1.Sub TIME2]
+params:
+ functions_and_methods:
+ related:
+ - functions/time/AsTime
+ returnType: time.Duration
+ signatures: [TIME1.Sub TIME2]
---
```go-html-template
diff --git a/content/en/methods/time/Truncate.md b/content/en/methods/time/Truncate.md
index 64751f2c1..f5fe10507 100644
--- a/content/en/methods/time/Truncate.md
+++ b/content/en/methods/time/Truncate.md
@@ -3,13 +3,14 @@ title: Truncate
description: Returns the result of rounding TIME down to a multiple of DURATION since January 1, 0001, 00:00:00 UTC.
categories: []
keywords: []
-action:
- related:
- - functions/time/AsTime
- - functions/time/ParseDuration
- - methods/time/Round
- returnType: time.Time
- signatures: [TIME.Truncate DURATION]
+params:
+ functions_and_methods:
+ related:
+ - functions/time/AsTime
+ - functions/time/ParseDuration
+ - methods/time/Round
+ returnType: time.Time
+ signatures: [TIME.Truncate DURATION]
---
The `Truncate` method operates on TIME as an absolute duration since the [zero time](g); it does not operate on the presentation form of the time. If DURATION is a multiple of one hour, `Truncate` may return a time with a non-zero minute, depending on the time zone.
diff --git a/content/en/methods/time/UTC.md b/content/en/methods/time/UTC.md
index 6fd7b526d..426a7ab60 100644
--- a/content/en/methods/time/UTC.md
+++ b/content/en/methods/time/UTC.md
@@ -3,12 +3,13 @@ title: UTC
description: Returns the given time.Time value with the location set to UTC.
categories: []
keywords: []
-action:
- related:
- - methods/time/Local
- - functions/time/AsTime
- returnType: time.Time
- signatures: [TIME.UTC]
+params:
+ functions_and_methods:
+ related:
+ - methods/time/Local
+ - functions/time/AsTime
+ returnType: time.Time
+ signatures: [TIME.UTC]
---
```go-html-template
diff --git a/content/en/methods/time/Unix.md b/content/en/methods/time/Unix.md
index fcfc661fe..d03974786 100644
--- a/content/en/methods/time/Unix.md
+++ b/content/en/methods/time/Unix.md
@@ -1,15 +1,16 @@
---
title: Unix
-description: Returns the given time.Time value expressed as the number of seconds elapsed since January 1, 1970 UTC.
+description: Returns the given time.Time value expressed as the number of seconds elapsed since January 1, 1970 UTC.
categories: []
-action:
- related:
- - methods/time/UnixMilli
- - methods/time/UnixMicro
- - methods/time/UnixNano
- - functions/time/AsTime
- returnType: int64
- signatures: [TIME.Unix]
+params:
+ functions_and_methods:
+ related:
+ - methods/time/UnixMilli
+ - methods/time/UnixMicro
+ - methods/time/UnixNano
+ - functions/time/AsTime
+ returnType: int64
+ signatures: [TIME.Unix]
aliases: [/functions/unix]
---
diff --git a/content/en/methods/time/UnixMicro.md b/content/en/methods/time/UnixMicro.md
index 150497cd3..e04a4b116 100644
--- a/content/en/methods/time/UnixMicro.md
+++ b/content/en/methods/time/UnixMicro.md
@@ -1,16 +1,17 @@
---
title: UnixMicro
-description: Returns the given time.Time value expressed as the number of microseconds elapsed since January 1, 1970 UTC.
+description: Returns the given time.Time value expressed as the number of microseconds elapsed since January 1, 1970 UTC.
categories: []
keywords: []
-action:
- related:
- - methods/time/Unix
- - methods/time/UnixMilli
- - methods/time/UnixNano
- - functions/time/AsTime
- returnType: int64
- signatures: [TIME.UnixMicro]
+params:
+ functions_and_methods:
+ related:
+ - methods/time/Unix
+ - methods/time/UnixMilli
+ - methods/time/UnixNano
+ - functions/time/AsTime
+ returnType: int64
+ signatures: [TIME.UnixMicro]
---
See [Unix epoch](https://en.wikipedia.org/wiki/Unix_time).
diff --git a/content/en/methods/time/UnixMilli.md b/content/en/methods/time/UnixMilli.md
index e5e90ba25..0d14131ce 100644
--- a/content/en/methods/time/UnixMilli.md
+++ b/content/en/methods/time/UnixMilli.md
@@ -1,16 +1,17 @@
---
title: UnixMilli
-description: Returns the given time.Time value expressed as the number of milliseconds elapsed since January 1, 1970 UTC.
+description: Returns the given time.Time value expressed as the number of milliseconds elapsed since January 1, 1970 UTC.
categories: []
keywords: []
-action:
- related:
- - methods/time/Unix
- - methods/time/UnixMicro
- - methods/time/UnixNano
- - functions/time/AsTime
- returnType: int64
- signatures: [TIME.UnixMilli]
+params:
+ functions_and_methods:
+ related:
+ - methods/time/Unix
+ - methods/time/UnixMicro
+ - methods/time/UnixNano
+ - functions/time/AsTime
+ returnType: int64
+ signatures: [TIME.UnixMilli]
---
See [Unix epoch](https://en.wikipedia.org/wiki/Unix_time).
diff --git a/content/en/methods/time/UnixNano.md b/content/en/methods/time/UnixNano.md
index 63db320a3..a6a4f83b2 100644
--- a/content/en/methods/time/UnixNano.md
+++ b/content/en/methods/time/UnixNano.md
@@ -1,16 +1,17 @@
---
title: UnixNano
-description: Returns the given time.Time value expressed as the number of nanoseconds elapsed since January 1, 1970 UTC.
+description: Returns the given time.Time value expressed as the number of nanoseconds elapsed since January 1, 1970 UTC.
categories: []
keywords: []
-action:
- related:
- - methods/time/Unix
- - methods/time/UnixMilli
- - methods/time/UnixMicro
- - functions/time/AsTime
- returnType: int64
- signatures: [TIME.UnixNano]
+params:
+ functions_and_methods:
+ related:
+ - methods/time/Unix
+ - methods/time/UnixMilli
+ - methods/time/UnixMicro
+ - functions/time/AsTime
+ returnType: int64
+ signatures: [TIME.UnixNano]
---
See [Unix epoch](https://en.wikipedia.org/wiki/Unix_time).
diff --git a/content/en/methods/time/Weekday.md b/content/en/methods/time/Weekday.md
index b2a95fe9c..06766a76a 100644
--- a/content/en/methods/time/Weekday.md
+++ b/content/en/methods/time/Weekday.md
@@ -1,13 +1,14 @@
---
title: Weekday
-description: Returns the day of the week of the given time.Time value.
+description: Returns the day of the week of the given time.Time value.
categories: []
keywords: []
-action:
- related:
- - functions/time/AsTime
- returnType: time.Weekday
- signatures: [TIME.Weekday]
+params:
+ functions_and_methods:
+ related:
+ - functions/time/AsTime
+ returnType: time.Weekday
+ signatures: [TIME.Weekday]
---
To convert the `time.Weekday` value to a string:
diff --git a/content/en/methods/time/Year.md b/content/en/methods/time/Year.md
index b046896f4..23641f55b 100644
--- a/content/en/methods/time/Year.md
+++ b/content/en/methods/time/Year.md
@@ -3,16 +3,17 @@ title: Year
description: Returns the year of the given time.Time value.
categories: []
keywords: []
-action:
- related:
- - methods/time/Month
- - methods/time/Day
- - methods/time/Hour
- - methods/time/Minute
- - methods/time/Second
- - functions/time/AsTime
- returnType: int
- signatures: [TIME.Year]
+params:
+ functions_and_methods:
+ related:
+ - methods/time/Month
+ - methods/time/Day
+ - methods/time/Hour
+ - methods/time/Minute
+ - methods/time/Second
+ - functions/time/AsTime
+ returnType: int
+ signatures: [TIME.Year]
---
```go-html-template
diff --git a/content/en/methods/time/YearDay.md b/content/en/methods/time/YearDay.md
index f380cdffe..39e7e9b7d 100644
--- a/content/en/methods/time/YearDay.md
+++ b/content/en/methods/time/YearDay.md
@@ -3,10 +3,11 @@ title: YearDay
description: Returns the day of the year of the given time.Time value, in the range [1, 365] for non-leap years, and [1, 366] in leap years.
categories: []
keywords: []
-action:
- related: []
- returnType: int
- signatures: [TIME.YearDay]
+params:
+ functions_and_methods:
+ related: []
+ returnType: int
+ signatures: [TIME.YearDay]
---
```go-html-template
diff --git a/content/en/methods/time/_index.md b/content/en/methods/time/_index.md
index 81d4690e0..8114664d3 100644
--- a/content/en/methods/time/_index.md
+++ b/content/en/methods/time/_index.md
@@ -4,10 +4,4 @@ linkTitle: Time
description: Use these methods with time.Time values.
categories: []
keywords: []
-menu:
- docs:
- identifier: time-methods
- parent: methods
---
-
-Use these methods with time.Time values.
diff --git a/content/en/myshowcase/featured.png b/content/en/myshowcase/featured.png
deleted file mode 100644
index 4f390132e..000000000
Binary files a/content/en/myshowcase/featured.png and /dev/null differ
diff --git a/content/en/news/_index.md b/content/en/news/_index.md
index c170a69a4..23c082cb7 100644
--- a/content/en/news/_index.md
+++ b/content/en/news/_index.md
@@ -4,6 +4,6 @@ description: Stay up-to-date with the latest news and announcements.
outputs:
- html
- rss
-aliases: [/release-notes/]
weight: 10
+aliases: [/release-notes/]
---
diff --git a/content/en/quick-reference/_index.md b/content/en/quick-reference/_index.md
index f2673ba37..98f978f4f 100644
--- a/content/en/quick-reference/_index.md
+++ b/content/en/quick-reference/_index.md
@@ -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 %}}
diff --git a/content/en/quick-reference/emojis.md b/content/en/quick-reference/emojis.md
index 946a49069..15c2e60e6 100644
--- a/content/en/quick-reference/emojis.md
+++ b/content/en/quick-reference/emojis.md
@@ -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
diff --git a/content/en/quick-reference/functions.md b/content/en/quick-reference/functions.md
index 42eafedd3..ee8844775 100644
--- a/content/en/quick-reference/functions.md
+++ b/content/en/quick-reference/functions.md
@@ -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" %}}
+{{< quick-reference section="functions" >}}
diff --git a/content/en/quick-reference/glossary/_index.md b/content/en/quick-reference/glossary/_index.md
index 238d4610d..42894c4da 100644
--- a/content/en/quick-reference/glossary/_index.md
+++ b/content/en/quick-reference/glossary/_index.md
@@ -1,17 +1,8 @@
---
title: Glossary
description: Terms commonly used throughout the documentation.
-categories: [quick-reference]
-keywords: [glossary]
-params:
- 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
@@ -19,6 +10,10 @@ cascade:
build:
render: never
list: local
+layout: single
+params:
+ hide_in_this_section: true
+aliases: [/getting-started/glossary/]
---
{{% glossary %}}
diff --git a/content/en/quick-reference/glossary/cli.md b/content/en/quick-reference/glossary/cli.md
index 61269dc8e..8f898e364 100644
--- a/content/en/quick-reference/glossary/cli.md
+++ b/content/en/quick-reference/glossary/cli.md
@@ -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.
diff --git a/content/en/quick-reference/glossary/default-sort-order.md b/content/en/quick-reference/glossary/default-sort-order.md
index 2b5588d56..9b981a7e9 100644
--- a/content/en/quick-reference/glossary/default-sort-order.md
+++ b/content/en/quick-reference/glossary/default-sort-order.md
@@ -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)
diff --git a/content/en/quick-reference/glossary/environment.md b/content/en/quick-reference/glossary/environment.md
index 6605c2263..ebba0ccdf 100644
--- a/content/en/quick-reference/glossary/environment.md
+++ b/content/en/quick-reference/glossary/environment.md
@@ -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.
diff --git a/content/en/quick-reference/glossary/glob.md b/content/en/quick-reference/glossary/glob.md
index 5243d1ef9..bb9c5a4d8 100644
--- a/content/en/quick-reference/glossary/glob.md
+++ b/content/en/quick-reference/glossary/glob.md
@@ -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.
diff --git a/content/en/quick-reference/glossary/interval.md b/content/en/quick-reference/glossary/interval.md
index f1ce7bc93..a7ed8a6cd 100644
--- a/content/en/quick-reference/glossary/interval.md
+++ b/content/en/quick-reference/glossary/interval.md
@@ -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, 1] is the interval where `0 <= x <= 1`.
+ - A _closed interval_, denoted by brackets, includes its endpoints. For example, [0, 1] is the interval where `0 <= x <= 1`.
-- An _open interval_, denoted by parentheses, excludes its endpoints. For example, (0, 1) is the interval where `0 < x < 1`.
+ - An _open interval_, denoted by parentheses, excludes its endpoints. For example, (0, 1) is the interval where `0 < x < 1`.
-- A _half-open interval_ includes only one of its endpoints. For example, (0, 1] is the _left-open_ interval where `0 < x <= 1`, while [0, 1) is the _right-open_ interval where `0 <= x < 1`.
+ - A _half-open interval_ includes only one of its endpoints. For example, (0, 1] is the _left-open_ interval where `0 < x <= 1`, while [0, 1) is the _right-open_ interval where `0 <= x < 1`.
diff --git a/content/en/quick-reference/glossary/logical-path.md b/content/en/quick-reference/glossary/logical-path.md
index aa5ce9374..2eeee751f 100644
--- a/content/en/quick-reference/glossary/logical-path.md
+++ b/content/en/quick-reference/glossary/logical-path.md
@@ -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 (`/`).
diff --git a/content/en/quick-reference/glossary/markdown-attribute.md b/content/en/quick-reference/glossary/markdown-attribute.md
index ccbcefd66..f5c57c728 100644
--- a/content/en/quick-reference/glossary/markdown-attribute.md
+++ b/content/en/quick-reference/glossary/markdown-attribute.md
@@ -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.
diff --git a/content/en/quick-reference/glossary/media-type.md b/content/en/quick-reference/glossary/media-type.md
new file mode 100644
index 000000000..2994360ef
--- /dev/null
+++ b/content/en/quick-reference/glossary/media-type.md
@@ -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`.
diff --git a/content/en/quick-reference/glossary/method.md b/content/en/quick-reference/glossary/method.md
index b7618bbf9..634cd4b97 100644
--- a/content/en/quick-reference/glossary/method.md
+++ b/content/en/quick-reference/glossary/method.md
@@ -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).
diff --git a/content/en/quick-reference/glossary/ordered-taxonomy.md b/content/en/quick-reference/glossary/ordered-taxonomy.md
index 7e0e2763d..9b6c1d92c 100644
--- a/content/en/quick-reference/glossary/ordered-taxonomy.md
+++ b/content/en/quick-reference/glossary/ordered-taxonomy.md
@@ -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).
diff --git a/content/en/quick-reference/glossary/output-format.md b/content/en/quick-reference/glossary/output-format.md
index 9004dc223..df042d06b 100644
--- a/content/en/quick-reference/glossary/output-format.md
+++ b/content/en/quick-reference/glossary/output-format.md
@@ -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.
diff --git a/content/en/quick-reference/glossary/pipeline.md b/content/en/quick-reference/glossary/pipeline.md
index 2bb3fa3b7..6dab52578 100644
--- a/content/en/quick-reference/glossary/pipeline.md
+++ b/content/en/quick-reference/glossary/pipeline.md
@@ -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.
diff --git a/content/en/quick-reference/glossary/primary-output-format.md b/content/en/quick-reference/glossary/primary-output-format.md
new file mode 100644
index 000000000..c40c0176c
--- /dev/null
+++ b/content/en/quick-reference/glossary/primary-output-format.md
@@ -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/
diff --git a/content/en/quick-reference/glossary/regular-expression.md b/content/en/quick-reference/glossary/regular-expression.md
new file mode 100644
index 000000000..222f289d9
--- /dev/null
+++ b/content/en/quick-reference/glossary/regular-expression.md
@@ -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
diff --git a/content/en/quick-reference/glossary/resource-type.md b/content/en/quick-reference/glossary/resource-type.md
index 64d9c27ab..9a2412fb9 100644
--- a/content/en/quick-reference/glossary/resource-type.md
+++ b/content/en/quick-reference/glossary/resource-type.md
@@ -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.
diff --git a/content/en/quick-reference/glossary/resource.md b/content/en/quick-reference/glossary/resource.md
index bd3a9d10d..0864bc43d 100644
--- a/content/en/quick-reference/glossary/resource.md
+++ b/content/en/quick-reference/glossary/resource.md
@@ -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).
diff --git a/content/en/quick-reference/glossary/scratch-pad.md b/content/en/quick-reference/glossary/scratch-pad.md
index f94d4fd5b..4792ce12e 100644
--- a/content/en/quick-reference/glossary/scratch-pad.md
+++ b/content/en/quick-reference/glossary/scratch-pad.md
@@ -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.
diff --git a/content/en/quick-reference/glossary/shortcode.md b/content/en/quick-reference/glossary/shortcode.md
index bfc2f6c51..a6503ea63 100644
--- a/content/en/quick-reference/glossary/shortcode.md
+++ b/content/en/quick-reference/glossary/shortcode.md
@@ -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.
diff --git a/content/en/quick-reference/glossary/template-action.md b/content/en/quick-reference/glossary/template-action.md
index d9a6c635c..e40c228fe 100644
--- a/content/en/quick-reference/glossary/template-action.md
+++ b/content/en/quick-reference/glossary/template-action.md
@@ -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 "{{" and "}}".
+A data evaluation or control structure within a [_template_](g), delimited by `{{` and `}}`.
diff --git a/content/en/quick-reference/methods.md b/content/en/quick-reference/methods.md
index 5b4797f3a..f8cf6b8c9 100644
--- a/content/en/quick-reference/methods.md
+++ b/content/en/quick-reference/methods.md
@@ -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" %}}
+{{< quick-reference section="methods" >}}
diff --git a/content/en/quick-reference/page-collections.md b/content/en/quick-reference/page-collections.md
index d7c081910..43b7178b3 100644
--- a/content/en/quick-reference/page-collections.md
+++ b/content/en/quick-reference/page-collections.md
@@ -1,27 +1,21 @@
---
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
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
@@ -31,25 +25,14 @@ Use the [`where`] function to filter page collections.
## 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. >}}
diff --git a/content/en/quick-reference/syntax-highlighting-styles.md b/content/en/quick-reference/syntax-highlighting-styles.md
new file mode 100644
index 000000000..68a03c8df
--- /dev/null
+++ b/content/en/quick-reference/syntax-highlighting-styles.md
@@ -0,0 +1,35 @@
+---
+title: Syntax highlighting styles
+description: Highlight code examples using one of these styles.
+categories: []
+keywords: []
+---
+
+## 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 %}}
diff --git a/content/en/render-hooks/_common/_index.md b/content/en/render-hooks/_common/_index.md
deleted file mode 100644
index 4328d4d14..000000000
--- a/content/en/render-hooks/_common/_index.md
+++ /dev/null
@@ -1,13 +0,0 @@
----
-cascade:
- _build:
- list: never
- publishResources: false
- render: never
----
-
-
diff --git a/content/en/render-hooks/_index.md b/content/en/render-hooks/_index.md
index 668808f44..a5e6203ff 100644
--- a/content/en/render-hooks/_index.md
+++ b/content/en/render-hooks/_index.md
@@ -1,17 +1,8 @@
---
title: Render hooks
-
description: Create render hooks to override the rendering of Markdown to HTML.
categories: []
keywords: []
-menu:
- docs:
- identifier: render-hooks-in-this-section
- parent: render-hooks
- weight: 10
weight: 10
-showSectionMenu: false
aliases: [/templates/render-hooks/]
---
-
-Create render hooks to override the rendering of Markdown to HTML.
diff --git a/content/en/render-hooks/blockquotes.md b/content/en/render-hooks/blockquotes.md
index 25daf5865..7b099372e 100755
--- a/content/en/render-hooks/blockquotes.md
+++ b/content/en/render-hooks/blockquotes.md
@@ -2,14 +2,8 @@
title: Blockquote render hooks
linkTitle: Blockquotes
description: Create a blockquote render hook to override the rendering of Markdown blockquotes to HTML.
-categories: [render hooks]
+categories: []
keywords: []
-menu:
- docs:
- parent: render-hooks
- weight: 30
-weight: 30
-toc: true
---
{{< new-in 0.132.0 />}}
@@ -18,58 +12,46 @@ toc: true
Blockquote render hook templates receive the following [context](g):
-###### AlertType
+AlertType
+: (`string`) Applicable when [`Type`](#type) is `alert`, this is the alert type converted to lowercase. See the [alerts](#alerts) section below.
-(`string`) Applicable when [`Type`](#type) is `alert`, this is the alert type converted to lowercase. See the [alerts](#alerts) section below.
+AlertTitle
+: {{< new-in 0.134.0 />}}
+: (`template.HTML`) Applicable when [`Type`](#type) is `alert`, this is the alert title. See the [alerts](#alerts) section below.
-###### AlertTitle
+AlertSign
+: {{< new-in 0.134.0 />}}
+: (`string`) Applicable when [`Type`](#type) is `alert`, this is the alert sign. Typically used to indicate whether an alert is graphically foldable, this is one of `+`, `-`, or an empty string. See the [alerts](#alerts) section below.
-{{< new-in 0.134.0 />}}
+Attributes
+: (`map`) The [Markdown attributes], available if you configure your site as follows:
-(`template.HTML`) Applicable when [`Type`](#type) is `alert`, this is the alert title. See the [alerts](#alerts) section below.
+ {{< code-toggle file=hugo >}}
+ [markup.goldmark.parser.attribute]
+ block = true
+ {{< /code-toggle >}}
-###### AlertSign
+Ordinal
+: (`int`) The zero-based ordinal of the blockquote on the page.
-{{< new-in 0.134.0 />}}
+Page
+: (`page`) A reference to the current page.
-(`string`) Applicable when [`Type`](#type) is `alert`, this is the alert sign. Typically used to indicate whether an alert is graphically foldable, this is one of `+`, `-`, or an empty string. See the [alerts](#alerts) section below.
+PageInner
+: (`page`) A reference to a page nested via the [`RenderShortcodes`] method. [See details](#pageinner-details).
-###### Attributes
+Position
+: (`string`) The position of the blockquote within the page content.
-(`map`) The [Markdown attributes], available if you configure your site as follows:
+Text
+: (`template.HTML`) The blockquote text, excluding the first line if [`Type`](#type) is `alert`. See the [alerts](#alerts) section below.
+
+Type
+: (`string`) The blockquote type. Returns `alert` if the blockquote has an alert designator, else `regular`. See the [alerts](#alerts) section below.
[Markdown attributes]: /content-management/markdown-attributes/
-
-{{< code-toggle file=hugo >}}
-[markup.goldmark.parser.attribute]
-block = true
-{{< /code-toggle >}}
-
-###### Ordinal
-
-(`int`) The zero-based ordinal of the blockquote on the page.
-
-###### Page
-
-(`page`) A reference to the current page.
-
-###### PageInner
-
-(`page`) A reference to a page nested via the [`RenderShortcodes`] method. [See details](#pageinner-details).
-
[`RenderShortcodes`]: /methods/page/rendershortcodes
-###### Position
-
-(`string`) The position of the blockquote within the page content.
-
-###### Text
-(`template.HTML`) The blockquote text, excluding the first line if [`Type`](#type) is `alert`. See the [alerts](#alerts) section below.
-
-###### Type
-
-(`bool`) The blockquote type. Returns `alert` if the blockquote has an alert designator, else `regular`. See the [alerts](#alerts) section below.
-
## Examples
In its default configuration, Hugo renders Markdown blockquotes according to the [CommonMark specification]. To create a render hook that does the same thing:
@@ -202,4 +184,4 @@ layouts/
└── render-blockquote-regular.html
```
-{{% include "/render-hooks/_common/pageinner.md" %}}
+{{% include "/_common/render-hooks/pageinner.md" %}}
diff --git a/content/en/render-hooks/code-blocks.md b/content/en/render-hooks/code-blocks.md
index 9622c3883..8e46532a5 100755
--- a/content/en/render-hooks/code-blocks.md
+++ b/content/en/render-hooks/code-blocks.md
@@ -2,14 +2,8 @@
title: Code block render hooks
linkTitle: Code blocks
description: Create a code block render hook to override the rendering of Markdown code blocks to HTML.
-categories: [render hooks]
+categories: []
keywords: []
-menu:
- docs:
- parent: render-hooks
- weight: 40
-weight: 40
-toc: true
---
## Markdown
@@ -56,42 +50,33 @@ Although `style` is a global HTML attribute, when used in an info string it is a
Code block render hook templates receive the following [context](g):
-###### Attributes
+Attributes
+: (`map`) The generic attributes from the info string.
-(`map`) The generic attributes from the info string.
+Inner
+: (`string`) The content between the leading and trailing code fences, excluding the info string.
-###### Inner
+Options
+: (`map`) The highlighting options from the info string.
-(`string`) The content between the leading and trailing code fences, excluding the info string.
+Ordinal
+: (`int`) The zero-based ordinal of the code block on the page.
-###### Options
+Page
+: (`page`) A reference to the current page.
-(`map`) The highlighting options from the info string.
+PageInner
+: {{< new-in 0.125.0 />}}
+: (`page`) A reference to a page nested via the [`RenderShortcodes`] method. [See details](#pageinner-details).
-###### Ordinal
+Position
+: (`text.Position`) The position of the code block within the page content.
-(`int`) The zero-based ordinal of the code block on the page.
-
-###### Page
-
-(`page`) A reference to the current page.
-
-###### PageInner
-
-{{< new-in 0.125.0 />}}
-
-(`page`) A reference to a page nested via the [`RenderShortcodes`] method. [See details](#pageinner-details).
+Type
+: (`string`) The first word of the info string, typically the code language.
[`RenderShortcodes`]: /methods/page/rendershortcodes
-###### Position
-
-(`text.Position`) The position of the code block within the page content.
-
-###### Type
-
-(`string`) The first word of the info string, typically the code language.
-
## Examples
In its default configuration, Hugo renders fenced code blocks by passing the code sample through the Chroma syntax highlighter and wrapping the result. To create a render hook that does the same thing:
@@ -147,4 +132,4 @@ Hugo includes an [embedded code block render hook] to render [GoAT diagrams].
[embedded code block render hook]: {{% eturl render-codeblock-goat %}}
[GoAT diagrams]: /content-management/diagrams/#goat-diagrams-ascii
-{{% include "/render-hooks/_common/pageinner.md" %}}
+{{% include "/_common/render-hooks/pageinner.md" %}}
diff --git a/content/en/render-hooks/headings.md b/content/en/render-hooks/headings.md
index 7c9d6b6fe..f4ded9b70 100755
--- a/content/en/render-hooks/headings.md
+++ b/content/en/render-hooks/headings.md
@@ -2,59 +2,44 @@
title: Heading render hooks
linkTitle: Headings
description: Create a heading render hook to override the rendering of Markdown headings to HTML.
-categories: [render hooks]
+categories: []
keywords: []
-menu:
- docs:
- parent: render-hooks
- weight: 50
-weight: 50
-toc: true
---
## Context
Heading render hook templates receive the following [context](g):
-###### Anchor
+Anchor
+: (`string`) The `id` attribute of the heading element.
-(`string`) The `id` attribute of the heading element.
+Attributes
+: (`map`) The [Markdown attributes], available if you configure your site as follows:
-###### Attributes
+ {{< code-toggle file=hugo >}}
+ [markup.goldmark.parser.attribute]
+ title = true
+ {{< /code-toggle >}}
-(`map`) The [Markdown attributes], available if you configure your site as follows:
+Level
+: (`int`) The heading level, 1 through 6.
+
+Page
+: (`page`) A reference to the current page.
+
+PageInner
+: {{< new-in 0.125.0 />}}
+: (`page`) A reference to a page nested via the [`RenderShortcodes`] method. [See details](#pageinner-details).
+
+PlainText
+: (`string`) The heading text as plain text.
+
+Text
+: (`template.HTML`) The heading text.
[Markdown attributes]: /content-management/markdown-attributes/
-
-{{< code-toggle file=hugo >}}
-[markup.goldmark.parser.attribute]
-title = true
-{{< /code-toggle >}}
-
-###### Level
-
-(`int`) The heading level, 1 through 6.
-
-###### Page
-
-(`page`) A reference to the current page.
-
-###### PageInner
-
-{{< new-in 0.125.0 />}}
-
-(`page`) A reference to a page nested via the [`RenderShortcodes`] method. [See details](#pageinner-details).
-
[`RenderShortcodes`]: /methods/page/rendershortcodes
-###### PlainText
-
-(`string`) The heading text as plain text.
-
-###### Text
-
-(`template.HTML`) The heading text.
-
## Examples
In its default configuration, Hugo renders Markdown headings according to the [CommonMark specification] with the addition of automatic `id` attributes. To create a render hook that does the same thing:
@@ -76,4 +61,4 @@ To add an anchor link to the right of each heading:
{{< /code >}}
-{{% include "/render-hooks/_common/pageinner.md" %}}
+{{% include "/_common/render-hooks/pageinner.md" %}}
diff --git a/content/en/render-hooks/images.md b/content/en/render-hooks/images.md
index e0e5ce99b..c443c38c1 100755
--- a/content/en/render-hooks/images.md
+++ b/content/en/render-hooks/images.md
@@ -2,14 +2,8 @@
title: Image render hooks
linkTitle: Images
description: Create an image render to hook override the rendering of Markdown images to HTML.
-categories: [render hooks]
+categories: []
keywords: []
-menu:
- docs:
- parent: render-hooks
- weight: 60
-weight: 60
-toc: true
---
## Markdown
@@ -28,55 +22,44 @@ These components are passed into the render hook [context](g) as shown below.
Image render hook templates receive the following context:
-###### Attributes
+Attributes
+: (`map`) The [Markdown attributes], available if you configure your site as follows:
-(`map`) The [Markdown attributes], available if you configure your site as follows:
+ {{< code-toggle file=hugo >}}
+ [markup.goldmark.parser]
+ wrapStandAloneImageWithinParagraph = false
+ [markup.goldmark.parser.attribute]
+ block = true
+ {{< /code-toggle >}}
+
+Destination
+: (`string`) The image destination.
+
+IsBlock
+: (`bool`) Reports whether a standalone image is not wrapped within a paragraph element.
+
+Ordinal
+: (`int`) The zero-based ordinal of the image on the page.
+
+Page
+: (`page`) A reference to the current page.
+
+PageInner
+: {{< new-in 0.125.0 />}}
+: (`page`) A reference to a page nested via the [`RenderShortcodes`] method. [See details](#pageinner-details).
+
+PlainText
+: (`string`) The image description as plain text.
+
+Text
+: (`template.HTML`) The image description.
+
+Title
+: (`string`) The image title.
[Markdown attributes]: /content-management/markdown-attributes/
-
-{{< code-toggle file=hugo >}}
-[markup.goldmark.parser]
-wrapStandAloneImageWithinParagraph = false
-[markup.goldmark.parser.attribute]
-block = true
-{{< /code-toggle >}}
-
-###### Destination
-
-(`string`) The image destination.
-
-###### IsBlock
-
-(`bool`) Returns true if a standalone image is not wrapped within a paragraph element.
-
-###### Ordinal
-
-(`int`) The zero-based ordinal of the image on the page.
-
-###### Page
-
-(`page`) A reference to the current page.
-
-###### PageInner
-
-{{< new-in 0.125.0 />}}
-
-(`page`) A reference to a page nested via the [`RenderShortcodes`] method. [See details](#pageinner-details).
-
[`RenderShortcodes`]: /methods/page/rendershortcodes
-###### PlainText
-
-(`string`) The image description as plain text.
-
-###### Text
-
-(`template.HTML`) The image description.
-
-###### Title
-
-(`string`) The image title.
-
## Examples
{{< note >}}
@@ -138,7 +121,7 @@ A custom render hook, even when provided by a theme or module, will override the
{{< note >}}
The embedded image render hook is automatically enabled for multilingual single-host sites if [duplication of shared page resources] is disabled. This is the default configuration for multilingual single-host sites.
-[duplication of shared page resources]: /getting-started/configuration-markup/#duplicateresourcefiles
+[duplication of shared page resources]: /configuration/markup/#duplicateresourcefiles
{{< /note >}}
The embedded image render hook resolves internal Markdown destinations by looking for a matching [page resource](g), falling back to a matching [global resource](g). Remote destinations are passed through, and the render hook will not throw an error or warning if unable to resolve a destination.
@@ -157,4 +140,4 @@ target = 'assets'
Note that the embedded image render hook does not perform image processing. Its sole purpose is to resolve Markdown image destinations.
-{{% include "/render-hooks/_common/pageinner.md" %}}
+{{% include "/_common/render-hooks/pageinner.md" %}}
diff --git a/content/en/render-hooks/introduction.md b/content/en/render-hooks/introduction.md
index f332043c5..4325294e3 100755
--- a/content/en/render-hooks/introduction.md
+++ b/content/en/render-hooks/introduction.md
@@ -1,14 +1,9 @@
---
title: Introduction
description: An introduction to Hugo's render hooks.
-categories: [render hooks]
+categories: []
keywords: []
-menu:
- docs:
- identifier: render-hooks-introduction
- parent: render-hooks
- weight: 20
-weight: 20
+weight: 10
---
When rendering Markdown to HTML, render hooks override the conversion. Each render hook is a template, with one template for each supported element type:
@@ -37,7 +32,7 @@ For example, consider this Markdown:

```
-Without link or image render hooks, this example above is rendered to:
+Without link or image render hooks, the example above is rendered to:
```html
diff --git a/content/en/render-hooks/links.md b/content/en/render-hooks/links.md
index 4c86557ea..cd7e043df 100755
--- a/content/en/render-hooks/links.md
+++ b/content/en/render-hooks/links.md
@@ -2,14 +2,8 @@
title: Link render hooks
linkTitle: Links
description: Create a link render hook to override the rendering of Markdown links to HTML.
-categories: [render hooks]
+categories: []
keywords: []
-menu:
- docs:
- parent: render-hooks
- weight: 70
-weight: 70
-toc: true
---
## Markdown
@@ -28,34 +22,27 @@ These components are passed into the render hook [context](g) as shown below.
Link render hook templates receive the following context:
-###### Destination
+Destination
+: (`string`) The link destination.
-(`string`) The link destination.
+Page
+: (`page`) A reference to the current page.
-###### Page
+PageInner
+: {{< new-in 0.125.0 />}}
+: (`page`) A reference to a page nested via the [`RenderShortcodes`] method. [See details](#pageinner-details).
-(`page`) A reference to the current page.
+PlainText
+: (`string`) The link description as plain text.
-###### PageInner
+Text
+: (`template.HTML`) The link description.
-{{< new-in 0.125.0 />}}
-
-(`page`) A reference to a page nested via the [`RenderShortcodes`] method. [See details](#pageinner-details).
+Title
+: (`string`) The link title.
[`RenderShortcodes`]: /methods/page/rendershortcodes
-###### PlainText
-
-(`string`) The link description as plain text.
-
-###### Text
-
-(`template.HTML`) The link description.
-
-###### Title
-
-(`string`) The link title.
-
## Examples
{{< note >}}
@@ -106,7 +93,7 @@ A custom render hook, even when provided by a theme or module, will override the
{{< note >}}
The embedded link render hook is automatically enabled for multilingual single-host sites if [duplication of shared page resources] is disabled. This is the default configuration for multilingual single-host sites.
-[duplication of shared page resources]: /getting-started/configuration-markup/#duplicateresourcefiles
+[duplication of shared page resources]: /configuration/markup/#duplicateresourcefiles
{{< /note >}}
The embedded link render hook resolves internal Markdown destinations by looking for a matching page, falling back to a matching [page resource](g), then falling back to a matching [global resource](g). Remote destinations are passed through, and the render hook will not throw an error or warning if unable to resolve a destination.
@@ -123,4 +110,4 @@ source = 'static'
target = 'assets'
{{< /code-toggle >}}
-{{% include "/render-hooks/_common/pageinner.md" %}}
+{{% include "/_common/render-hooks/pageinner.md" %}}
diff --git a/content/en/render-hooks/passthrough.md b/content/en/render-hooks/passthrough.md
index 798225061..bfbf4d5fb 100755
--- a/content/en/render-hooks/passthrough.md
+++ b/content/en/render-hooks/passthrough.md
@@ -1,25 +1,19 @@
---
title: Passthrough render hooks
linkTitle: Passthrough
-description: Create a passthrough render hook to override the rendering of text snippets captured by the Goldmark passthrough extension.
-categories: [render hooks]
+description: Create a passthrough render hook to override the rendering of text snippets captured by the Goldmark Passthrough extension.
+categories: []
keywords: []
-menu:
- docs:
- parent: render-hooks
- weight: 80
-weight: 80
-toc: true
---
{{< new-in 0.132.0 />}}
## Overview
-Hugo uses [Goldmark] to render Markdown to HTML. Goldmark supports custom extensions to extend its core functionality. The Goldmark [passthrough extension] captures and preserves raw Markdown within delimited snippets of text, including the delimiters themselves. These are known as _passthrough elements_.
+Hugo uses [Goldmark] to render Markdown to HTML. Goldmark supports custom extensions to extend its core functionality. The [Passthrough] extension captures and preserves raw Markdown within delimited snippets of text, including the delimiters themselves. These are known as _passthrough elements_.
[Goldmark]: https://github.com/yuin/goldmark
-[passthrough extension]: /getting-started/configuration-markup/#passthrough
+[Passthrough]: /configuration/markup/#passthrough
Depending on your choice of delimiters, Hugo will classify a passthrough element as either _block_ or _inline_. Consider this contrived example:
@@ -33,7 +27,7 @@ passthrough element with opening and closing block delimiters.
This is an \(inline\) passthrough element with opening and closing inline delimiters.
{{< /code >}}
-Update your site configuration to enable the passthrough extension and define opening and closing delimiters for each passthrough element type, either `block` or `inline`. For example:
+Update your site configuration to enable the Passthrough extension and define opening and closing delimiters for each passthrough element type, either `block` or `inline`. For example:
{{< code-toggle file=hugo >}}
[markup.goldmark.extensions.passthrough]
@@ -45,7 +39,7 @@ inline = [['\(', '\)']]
In the example above there are two sets of `block` delimiters. You may use either one in your Markdown.
-The Goldmark passthrough extension is often used in conjunction with the MathJax or KaTeX display engine to render [mathematical expressions] written in the LaTeX markup language.
+The Passthrough extension is often used in conjunction with the MathJax or KaTeX display engine to render [mathematical expressions] written in the LaTeX markup language.
[mathematical expressions]: /content-management/mathematics/
@@ -55,44 +49,37 @@ To enable custom rendering of passthrough elements, create a passthrough render
Passthrough render hook templates receive the following [context](g):
-###### Attributes
+Attributes
+: (`map`) The [Markdown attributes], available if you configure your site as follows:
-(`map`) The [Markdown attributes], available if you configure your site as follows:
+ {{< code-toggle file=hugo >}}
+ [markup.goldmark.parser.attribute]
+ block = true
+ {{< /code-toggle >}}
+
+ Hugo populates the `Attributes` map for _block_ passthrough elements. Markdown attributes are not applicable to _inline_ elements.
+
+Inner
+: (`string`) The inner content of the passthrough element, excluding the delimiters.
+
+Ordinal
+: (`int`) The zero-based ordinal of the passthrough element on the page.
+
+Page
+: (`page`) A reference to the current page.
+
+PageInner
+: (`page`) A reference to a page nested via the [`RenderShortcodes`] method. [See details](#pageinner-details).
+
+Position
+: (`string`) The position of the passthrough element within the page content.
+
+Type
+: (`string`) The passthrough element type, either `block` or `inline`.
[Markdown attributes]: /content-management/markdown-attributes/
-
-{{< code-toggle file=hugo >}}
-[markup.goldmark.parser.attribute]
-block = true
-{{< /code-toggle >}}
-
-Hugo populates the `Attributes` map for _block_ passthrough elements. Markdown attributes are not applicable to _inline_ elements.
-
-###### Inner
-(`string`) The inner content of the passthrough element, excluding the delimiters.
-
-###### Ordinal
-
-(`int`) The zero-based ordinal of the passthrough element on the page.
-
-###### Page
-
-(`page`) A reference to the current page.
-
-###### PageInner
-
-(`page`) A reference to a page nested via the [`RenderShortcodes`] method. [See details](#pageinner-details).
-
[`RenderShortcodes`]: /methods/page/rendershortcodes
-###### Position
-
-(`string`) The position of the passthrough element within the page content.
-
-###### Type
-
-(`string`) The passthrough element type, either `block` or `inline`.
-
## Example
Instead of client-side JavaScript rendering of mathematical markup using MathJax or KaTeX, create a passthrough render hook which calls the [`transform.ToMath`] function.
@@ -134,4 +121,4 @@ layouts/
└── render-passthrough-inline.html
```
-{{% include "/render-hooks/_common/pageinner.md" %}}
+{{% include "/_common/render-hooks/pageinner.md" %}}
diff --git a/content/en/render-hooks/tables.md b/content/en/render-hooks/tables.md
index d131664fc..eeda80692 100755
--- a/content/en/render-hooks/tables.md
+++ b/content/en/render-hooks/tables.md
@@ -2,14 +2,8 @@
title: Table render hooks
linkTitle: Tables
description: Create a table render hook to override the rendering of Markdown tables to HTML.
-categories: [render hooks]
+categories: []
keywords: []
-menu:
- docs:
- parent: render-hooks
- weight: 90
-weight: 90
-toc: true
---
{{< new-in 0.134.0 />}}
@@ -18,50 +12,44 @@ toc: true
Table render hook templates receive the following [context](g):
-###### Attributes
+Attributes
+: (`map`) The [Markdown attributes], available if you configure your site as follows:
-(`map`) The [Markdown attributes], available if you configure your site as follows:
+ {{< code-toggle file=hugo >}}
+ [markup.goldmark.parser.attribute]
+ block = true
+ {{< /code-toggle >}}
+
+Ordinal
+: (`int`) The zero-based ordinal of the table on the page.
+
+Page
+: (`page`) A reference to the current page.
+
+PageInner
+: (`page`) A reference to a page nested via the [`RenderShortcodes`] method. [See details](#pageinner-details).
+
+Position
+: (`string`) The position of the table within the page content.
+
+THead
+: (`slice`) A slice of table header rows, where each element is a slice of table cells.
+
+TBody
+: (`slice`) A slice of table body rows, where each element is a slice of table cells.
[Markdown attributes]: /content-management/markdown-attributes/
-
-{{< code-toggle file=hugo >}}
-[markup.goldmark.parser.attribute]
-block = true
-{{< /code-toggle >}}
-
-###### Ordinal
-
-(`int`) The zero-based ordinal of the table on the page.
-
-###### Page
-
-(`page`) A reference to the current page.
-
-###### PageInner
-
-(`page`) A reference to a page nested via the [`RenderShortcodes`] method. [See details](#pageinner-details).
-
[`RenderShortcodes`]: /methods/page/rendershortcodes
-###### Position
-
-(`string`) The position of the table within the page content.
-
-###### THead
-(`slice`) A slice of table header rows, where each element is a slice of table cells.
-
-###### TBody
-(`slice`) A slice of table body rows, where each element is a slice of table cells.
-
## Table cells
Each table cell within the slice of slices returned by the `THead` and `TBody` methods has the following fields:
-###### Alignment
-(`string`) The alignment of the text within the table cell, one of `left`, `center`, or `right`.
+Alignment
+: (`string`) The alignment of the text within the table cell, one of `left`, `center`, or `right`.
-###### Text
-(`template.HTML`) The text within the table cell.
+Text
+: (`template.HTML`) The text within the table cell.
## Example
@@ -109,4 +97,4 @@ In its default configuration, Hugo renders Markdown tables according to the [Git
{{< /code >}}
-{{% include "/render-hooks/_common/pageinner.md" %}}
+{{% include "/_common/render-hooks/pageinner.md" %}}
diff --git a/content/en/shortcodes/_index.md b/content/en/shortcodes/_index.md
index 2d9a8fdd6..826ee5796 100644
--- a/content/en/shortcodes/_index.md
+++ b/content/en/shortcodes/_index.md
@@ -1,16 +1,7 @@
---
title: Shortcodes
-
description: Insert elements such as videos, images, and social media embeds into your content using Hugo's embedded shortcodes.
categories: []
keywords: []
-menu:
- docs:
- identifier: shortcodes-in-this-section
- parent: shortcodes
- weight: 10
weight: 10
-showSectionMenu: true
---
-
-Insert elements such as videos, images, and social media embeds into your content using Hugo's embedded shortcodes.
diff --git a/content/en/shortcodes/comment.md b/content/en/shortcodes/comment.md
index c87765a6b..e3bb621ca 100755
--- a/content/en/shortcodes/comment.md
+++ b/content/en/shortcodes/comment.md
@@ -1,14 +1,8 @@
---
title: Comment
description: Include hidden comments in your content with the comment shortcode.
-categories: [shortcodes]
+categories: []
keywords: []
-menu:
- docs:
- identifier: shortcodes-comment
- parent: shortcodes
- weight:
-weight:
expiryDate: 2025-01-22 # deprecated 2025-02-01 in v0.143.0 and immediately removed from the documentation
---
diff --git a/content/en/shortcodes/details.md b/content/en/shortcodes/details.md
index 029429e2d..82c950349 100755
--- a/content/en/shortcodes/details.md
+++ b/content/en/shortcodes/details.md
@@ -1,14 +1,8 @@
---
title: Details
description: Insert an HTML details element into your content using the details shortcode.
-categories: [shortcodes]
+categories: []
keywords: []
-menu:
- docs:
- parent: shortcodes
- weight:
-weight:
-toc: true
---
{{< new-in 0.140.0 />}}
@@ -44,7 +38,7 @@ Which looks like this in your browser:
This is a **bold** word.
{{< /details >}}
-## Parameters
+## Arguments
summary
: (`string`) The content of the child `summary` element rendered from Markdown to HTML. Default is `Details`.
diff --git a/content/en/shortcodes/figure.md b/content/en/shortcodes/figure.md
index 69aafe894..8e77ab4f4 100755
--- a/content/en/shortcodes/figure.md
+++ b/content/en/shortcodes/figure.md
@@ -1,14 +1,8 @@
---
title: Figure
description: Insert an HTML figure element into your content using the figure shortcode.
-categories: [shortcodes]
+categories: []
keywords: []
-menu:
- docs:
- parent: shortcodes
- weight:
-weight:
-toc: true
---
{{< note >}}
@@ -57,7 +51,7 @@ Which looks like this in your browser:
class="ma0 w-75"
>}}
-## Parameters
+## Arguments
src
: (`string`) The `src` attribute of the `img` element. Typically this is a [page resource](g) or a [global resource](g).
diff --git a/content/en/shortcodes/gist.md b/content/en/shortcodes/gist.md
index 8a247be8d..bd8367691 100755
--- a/content/en/shortcodes/gist.md
+++ b/content/en/shortcodes/gist.md
@@ -1,13 +1,8 @@
---
title: Gist
description: Embed a GitHub Gist in your content using the gist shortcode.
-categories: [shortcodes]
+categories: []
keywords: []
-menu:
- docs:
- parent: shortcodes
- weight:
-weight:
expiryDate: 2027-02-01 # deprecated 2025-02-01 in v0.143.0
---
@@ -15,7 +10,7 @@ expiryDate: 2027-02-01 # deprecated 2025-02-01 in v0.143.0
The `gist` shortcode was deprecated in version 0.143.0 and will be removed in a future release. To continue embedding GitHub Gists in your content, you'll need to create a custom shortcode:
1. Create a new file: Create a file named `gist.html` within the `layouts/shortcodes` directory.
-2. Copy the source code: Paste the [original source code] of the gist shortcode into the newly created `gist.html` file.
+1. Copy the source code: Paste the [original source code] of the gist shortcode into the newly created `gist.html` file.
This will allow you to maintain the functionality of embedding GitHub Gists in your content after the deprecation of the original shortcode.
diff --git a/content/en/shortcodes/highlight.md b/content/en/shortcodes/highlight.md
index b6ffe547f..74d8e7d65 100755
--- a/content/en/shortcodes/highlight.md
+++ b/content/en/shortcodes/highlight.md
@@ -1,14 +1,8 @@
---
title: Highlight
description: Insert syntax-highlighted code into your content using the highlight shortcode.
-categories: [shortcodes]
+categories: []
keywords: []
-menu:
- docs:
- parent: shortcodes
- weight:
-weight:
-toc: true
---
{{< note >}}
@@ -25,10 +19,10 @@ The primary use case for the `highlight` shortcode in Markdown is to apply synta
[content format]: /content-management/formats/
{{< /note >}}
-The `highlight` shortcode calls the [`transform.Highlight`] function which uses the [Chroma] syntax highlighter, supporting over 200 languages with more than 40 [available styles].
+The `highlight` shortcode calls the [`transform.Highlight`] function which uses the [Chroma] syntax highlighter, supporting over 200 languages with more than 40 [highlighting styles].
[chroma]: https://github.com/alecthomas/chroma
-[available styles]: https://xyproto.github.io/splash/docs/
+[highlighting styles]: /quick-reference/syntax-highlighting-styles/
[`transform.Highlight`]: /functions/transform/highlight/
## Arguments
@@ -50,13 +44,13 @@ LANG
OPTIONS
: (`string`) Zero or more space-separated key-value pairs wrapped in quotation marks. Set default values for each option in your [site configuration]. The key names are case-insensitive.
-[site configuration]: /getting-started/configuration-markup#highlight
-[supported languages]: /content-management/syntax-highlighting/#list-of-chroma-highlighting-languages
+[site configuration]: /configuration/markup/#highlight
+[supported languages]: /content-management/syntax-highlighting/#languages
## Example
```text
-{{* highlight go "linenos=inline, hl_Lines=3 6-8, style=emacs" */>}}
+{{* highlight go "linenos=inline, hl_lines=3 6-8, style=emacs" */>}}
package main
import "fmt"
@@ -97,7 +91,7 @@ Given the verbosity of the example above, if you need to frequently highlight in
{{< code file=layouts/shortcodes/hl.html >}}
{{ $code := .Inner | strings.TrimSpace }}
-{{ $lang := or (.Get 0) "go" }}
+{{ $lang := or (.Get 0) "go" }}
{{ $opts := dict "hl_inline" true "noClasses" true }}
{{ transform.Highlight $code $lang $opts }}
{{< /code >}}
@@ -114,4 +108,4 @@ This is some {{< hl >}}fmt.Println("inline"){{< /hl >}} code.
Pass the options when calling the shortcode. You can set their default values in your [site configuration].
-{{% include "functions/_common/highlighting-options" %}}
+{{% include "_common/syntax-highlighting-options.md" %}}
diff --git a/content/en/shortcodes/instagram.md b/content/en/shortcodes/instagram.md
index ffe739966..da7c912d6 100755
--- a/content/en/shortcodes/instagram.md
+++ b/content/en/shortcodes/instagram.md
@@ -1,14 +1,8 @@
---
title: Instagram
description: Embed an Instagram post in your content using the instagram shortcode.
-categories: [shortcodes]
+categories: []
keywords: []
-menu:
- docs:
- parent: shortcodes
- weight:
-weight:
-toc: true
---
{{< note >}}
diff --git a/content/en/shortcodes/param.md b/content/en/shortcodes/param.md
index b7bd31e47..77b8f7711 100755
--- a/content/en/shortcodes/param.md
+++ b/content/en/shortcodes/param.md
@@ -1,13 +1,8 @@
---
title: Param
description: Insert a parameter from front matter or site configuration into your content using the param shortcode.
-categories: [shortcodes]
+categories: []
keywords: []
-menu:
- docs:
- parent: shortcodes
- weight:
-weight:
---
{{< note >}}
@@ -18,7 +13,7 @@ To override Hugo's embedded `param` shortcode, copy the [source code] to a file
The `param` shortcode renders a parameter from front matter, falling back to a site parameter of the same name. The shortcode throws an error if the parameter does not exist.
-{{< code file=example.md lang=text >}}
+{{< code file=example.md >}}
---
title: Example
date: 2025-01-15T23:29:46-08:00
diff --git a/content/en/shortcodes/qr.md b/content/en/shortcodes/qr.md
index 2a82b919f..036798a4b 100755
--- a/content/en/shortcodes/qr.md
+++ b/content/en/shortcodes/qr.md
@@ -1,14 +1,8 @@
---
title: QR
description: Insert a QR code into your content using the qr shortcode.
-categories: [shortcodes]
+categories: []
keywords: []
-menu:
- docs:
- parent: shortcodes
- weight:
-weight:
-toc: true
---
{{< new-in 0.141.0 />}}
@@ -84,7 +78,7 @@ EMAIL;TYPE=WORK:jsmith@example.org
END:VCARD
{{< /qr >}}
-## Parameters
+## Arguments
text
: (`string`) The text to encode, falling back to the text between the opening and closing shortcode tags.
@@ -98,7 +92,7 @@ scale
targetDir
: (`string`) The subdirectory within the [`publishDir`] where Hugo will place the generated image.
-[`publishDir`]: /getting-started/configuration/#publishdir
+[`publishDir`]: /configuration/all/#publishdir
alt
: (`string`) The `alt` attribute of the `img` element.
@@ -109,5 +103,8 @@ class
id
: (`string`) The `id` attribute of the `img` element.
+loading
+: (`string`) The `loading` attribute of the `img` element, either `eager` or `lazy`.
+
title
: (`string`) The `title` attribute of the `img` element.
diff --git a/content/en/shortcodes/ref.md b/content/en/shortcodes/ref.md
index e5d7117c8..de915a5ce 100755
--- a/content/en/shortcodes/ref.md
+++ b/content/en/shortcodes/ref.md
@@ -1,13 +1,8 @@
---
title: Ref
description: Insert a permalink to the given page reference using the ref shortcode.
-categories: [shortcodes]
+categories: []
keywords: []
-menu:
- docs:
- parent: shortcodes
- weight:
-weight:
---
{{< note >}}
@@ -23,28 +18,51 @@ When working with the Markdown [content format], this shortcode has become large
[link render hooks]: /render-hooks/images/#default
{{< /note >}}
-The `ref` shortcode returns the permalink of the given page reference.
+## Usage
-Example usage:
+The `ref` shortcode accepts either a single positional argument (the path) or one or more named arguments, as listed below.
-```text
-[Post 1]({{%/* ref "/posts/post-1" */%}})
-[Post 1]({{%/* ref "/posts/post-1.md" */%}})
-[Post 1]({{%/* ref "/posts/post-1#foo" */%}})
-[Post 1]({{%/* ref "/posts/post-1.md#foo" */%}})
-```
+## Arguments
-Rendered:
+{{% include "_common/ref-and-relref-options.md" %}}
-```html
-Post 1
-Post 1
-Post 1
-Post 1
-```
+## Examples
+
+The `ref` shortcode typically provides the destination for a Markdown link.
{{< note >}}
Always use [Markdown notation] notation when calling this shortcode.
[Markdown notation]: /content-management/shortcodes/#notation
{{< /note >}}
+
+The following examples show the rendered output for a page on the English version of the site:
+
+```md
+[Link A]({{%/* ref "/books/book-1" */%}})
+
+[Link B]({{%/* ref path="/books/book-1" */%}})
+
+[Link C]({{%/* ref path="/books/book-1" lang="de" */%}})
+
+[Link D]({{%/* ref path="/books/book-1" lang="de" outputFormat="json" */%}})
+```
+
+Rendered:
+
+```html
+Link A
+
+Link B
+
+Link C
+
+Link D
+```
+
+
+
+
+## Error handling
+
+{{% include "_common/ref-and-relref-error-handling.md" %}}
diff --git a/content/en/shortcodes/relref.md b/content/en/shortcodes/relref.md
index 603427cb1..3895e91e4 100755
--- a/content/en/shortcodes/relref.md
+++ b/content/en/shortcodes/relref.md
@@ -1,13 +1,8 @@
---
title: Relref
description: Insert a relative permalink to the given page reference using the relref shortcode.
-categories: [shortcodes]
+categories: []
keywords: []
-menu:
- docs:
- parent: shortcodes
- weight:
-weight:
---
{{< note >}}
@@ -23,28 +18,48 @@ When working with the Markdown [content format], this shortcode has become large
[link render hooks]: /render-hooks/links/
{{< /note >}}
-The `relref` shortcode returns the relative permalink of the given page reference.
+## Usage
-Example usage:
+The `relref` shortcode accepts either a single positional argument (the path) or one or more named arguments, as listed below.
-```text
-[Post 1]({{%/* relref "/posts/post-1" */%}})
-[Post 1]({{%/* relref "/posts/post-1.md" */%}})
-[Post 1]({{%/* relref "/posts/post-1#foo" */%}})
-[Post 1]({{%/* relref "/posts/post-1.md#foo" */%}})
-```
+## Arguments
-Rendered:
+{{% include "_common/ref-and-relref-options.md" %}}
-```html
-Post 1
-Post 1
-Post 1
-Post 1
-```
+## Examples
+
+The `relref` shortcode typically provides the destination for a Markdown link.
{{< note >}}
Always use [Markdown notation] notation when calling this shortcode.
[Markdown notation]: /content-management/shortcodes/#notation
{{< /note >}}
+
+The following examples show the rendered output for a page on the English version of the site:
+
+```md
+[Link A]({{%/* ref "/books/book-1" */%}})
+
+[Link B]({{%/* ref path="/books/book-1" */%}})
+
+[Link C]({{%/* ref path="/books/book-1" lang="de" */%}})
+
+[Link D]({{%/* ref path="/books/book-1" lang="de" outputFormat="json" */%}})
+```
+
+Rendered:
+
+```html
+Link A
+
+Link B
+
+Link C
+
+Link D
+```
+
+## Error handling
+
+{{% include "_common/ref-and-relref-error-handling.md" %}}
diff --git a/content/en/shortcodes/vimeo.md b/content/en/shortcodes/vimeo.md
index 2d852471a..1156da91e 100755
--- a/content/en/shortcodes/vimeo.md
+++ b/content/en/shortcodes/vimeo.md
@@ -1,14 +1,8 @@
---
title: Vimeo
description: Embed a Vimeo video in your content using the vimeo shortcode.
-categories: [shortcodes]
+categories: []
keywords: []
-menu:
- docs:
- parent: shortcodes
- weight:
-weight:
-toc: true
---
{{< note >}}
@@ -35,7 +29,7 @@ Hugo renders this to:
{{< vimeo 55073825 >}}
-## Parameters
+## Arguments
class
: (`string`) The `class` attribute of the wrapping `div` element. Adding one or more CSS classes disables inline styling.
diff --git a/content/en/shortcodes/x.md b/content/en/shortcodes/x.md
index c2f7a58fe..30759cc59 100755
--- a/content/en/shortcodes/x.md
+++ b/content/en/shortcodes/x.md
@@ -1,14 +1,8 @@
---
title: X
description: Embed an X post in your content using the x shortcode.
-categories: [shortcodes]
+categories: []
keywords: []
-menu:
- docs:
- parent: shortcodes
- weight:
-weight:
-toc: true
---
{{< new-in 0.141.0 />}}
diff --git a/content/en/shortcodes/youtube.md b/content/en/shortcodes/youtube.md
index 1c356c732..3e552d43c 100755
--- a/content/en/shortcodes/youtube.md
+++ b/content/en/shortcodes/youtube.md
@@ -1,14 +1,8 @@
---
title: YouTube
description: Embed a YouTube video in your content using the youtube shortcode.
-categories: [shortcodes]
+categories: []
keywords: []
-menu:
- docs:
- parent: shortcodes
- weight:
-weight:
-toc: true
---
{{< note >}}
@@ -27,7 +21,7 @@ https://www.youtube.com/watch?v=0RKpf3rK57I
Include this in your Markdown:
-```text
+```texts
{{* youtube 0RKpf3rK57I */>}}
```
@@ -35,7 +29,7 @@ Hugo renders this to:
{{< youtube 0RKpf3rK57I >}}
-## Parameters
+## Arguments
id
: (`string`) The video `id`. Optional if the `id` is provided as a positional argument as shown in the example above.
@@ -65,7 +59,7 @@ loading
loop
{{< new-in 0.125.0 />}}
-: (`bool`) Whether to indefinitely repeat the video. Ignores the `start` and `end` arguments after the first play. Default is `false`.
+: (`bool`) Whether to indefinitely repeat the video. Ignores the `start` and `end` arguments after the first play. Default is `false`.
mute
{{< new-in 0.125.0 />}}
diff --git a/content/en/showcase/1password-support/bio.md b/content/en/showcase/1password-support/bio.md
index 3e15adc9f..32d299bd4 100644
--- a/content/en/showcase/1password-support/bio.md
+++ b/content/en/showcase/1password-support/bio.md
@@ -1,4 +1,3 @@
-
**1Password** is a password manager that keeps you safe online. It protects your secure information behind the one password only you know.
The [1Password Support](https://support.1password.com/) website was built from scratch with **Hugo** and enhanced with **React** and **Elasticsearch** to give us the best of both worlds: The simplicity and performance of a static site, with the richness of a hosted web app.
diff --git a/content/en/showcase/1password-support/index.md b/content/en/showcase/1password-support/index.md
index c0a66ce45..54a30f849 100644
--- a/content/en/showcase/1password-support/index.md
+++ b/content/en/showcase/1password-support/index.md
@@ -1,12 +1,10 @@
---
-
title: 1Password Support
date: 2018-02-22
-description: "Showcase: \"Compiles 400 pages in five languages in the blink of an eye.\""
+description: 'Showcase: "Compiles 400 pages in five languages in the blink of an eye."'
siteURL: https://support.1password.com/
byline: "[Mitch Cohen](https://github.com/mitchchn), Documentation Team Lead"
aliases: [/showcase/1password/]
-
---
At 1Password, we used to go through a different documentation platform every month: blog engines, ebooks, wikis, site generators written in Ruby and JavaScript. Each was inadequate in its own special way. Then we found **Hugo**. We made one last switch, and we're glad we did.
@@ -31,9 +29,9 @@ Finding a tool that will make your customers, writers, designers, _and_ DevOps t
### Tech specs
-* [1Password Support](https://support.1password.com) uses Hugo with a custom theme. It shares styles and some template code with [1Password.com](https://1password.com), which we also moved to Hugo in 2016.
-* Code and articles live in a private GitHub repository, which is deployed to a static content server using Git hooks.
-* Writers build and preview the site on their computers and contribute content using pull requests.
-* We use Hugo's [multilingual support](/content-management/multilingual/) to build the site in English, Spanish, French, Italian, German, and Russian. With the help of Hugo, 1Password Support became our very first site in multiple languages.
-* Our [contact form](https://support.1password.com/contact) is a single-page React app. We were able to integrate it with Hugo seamlessly thanks to its support for static files.
-* The one part of the support site which is not static is our search engine, which we developed with Elasticsearch and host on AWS.
+- [1Password Support](https://support.1password.com) uses Hugo with a custom theme. It shares styles and some template code with [1Password.com](https://1password.com), which we also moved to Hugo in 2016.
+- Code and articles live in a private GitHub repository, which is deployed to a static content server using Git hooks.
+- Writers build and preview the site on their computers and contribute content using pull requests.
+- We use Hugo's [multilingual support](/content-management/multilingual/) to build the site in English, Spanish, French, Italian, German, and Russian. With the help of Hugo, 1Password Support became our very first site in multiple languages.
+- Our [contact form](https://support.1password.com/contact) is a single-page React app. We were able to integrate it with Hugo seamlessly thanks to its support for static files.
+- The one part of the support site which is not static is our search engine, which we developed with Elasticsearch and host on AWS.
diff --git a/content/en/showcase/_index.md b/content/en/showcase/_index.md
index cec1936ea..e618e8104 100644
--- a/content/en/showcase/_index.md
+++ b/content/en/showcase/_index.md
@@ -1,4 +1,7 @@
---
title: Showcases
-draft: true
+cascade:
+ build:
+ render: never
+ list: never
---
diff --git a/content/en/myshowcase/bio.md b/content/en/showcase/_template/bio.md
similarity index 51%
rename from content/en/myshowcase/bio.md
rename to content/en/showcase/_template/bio.md
index 6b8f7e1a9..5ea389617 100644
--- a/content/en/myshowcase/bio.md
+++ b/content/en/showcase/_template/bio.md
@@ -1,7 +1,6 @@
-
Add some **general info** about Myshowcase here.
The site is built by:
-* [Person 1](https://example.org)
-* [Person 1](https://example.org)
+- [Person 1](https://example.org)
+- [Person 1](https://example.org)
diff --git a/archetypes/showcase/featured.png b/content/en/showcase/_template/featured.png
similarity index 100%
rename from archetypes/showcase/featured.png
rename to content/en/showcase/_template/featured.png
diff --git a/content/en/myshowcase/index.md b/content/en/showcase/_template/index.md
similarity index 90%
rename from content/en/myshowcase/index.md
rename to content/en/showcase/_template/index.md
index abb4ad6b2..3103903e1 100644
--- a/content/en/myshowcase/index.md
+++ b/content/en/showcase/_template/index.md
@@ -1,21 +1,15 @@
---
-
title: Myshowcase
-date: 2021-01-14
+date:
draft: true
-
-description: "A short description of this page."
-
+description: A short description of this page.
# The URL to the site on the internet.
siteURL: https://gohugo.io/
-
# Link to the site's Hugo source code if public and you can/want to share.
# Remove or leave blank if not needed/wanted.
siteSource: https://github.com/gohugoio/hugoDocs
-
# Add credit to the article author. Leave blank or remove if not needed/wanted.
-byline: "[bep](https://github.com/bep), Hugo Lead"
-
+byline: '[bep](https://github.com/bep), Hugo Lead'
---
To complete this showcase:
diff --git a/content/en/showcase/alora-labs/index.md b/content/en/showcase/alora-labs/index.md
index 559169319..5e676bad3 100644
--- a/content/en/showcase/alora-labs/index.md
+++ b/content/en/showcase/alora-labs/index.md
@@ -1,7 +1,7 @@
---
title: Alora Labs
date: 2021-05-27
-description: "Showcase: \"Making performant websites accessible for everyone.\""
+description: 'Showcase: "Making performant websites accessible for everyone."'
siteURL: https://aloralabs.com/
siteSource: https://github.com/aloralabs/homepage
aliases: [/showcase/aloralabs/]
diff --git a/content/en/showcase/ampio-help/bio.md b/content/en/showcase/ampio-help/bio.md
index c7dd9894a..a08b26be7 100644
--- a/content/en/showcase/ampio-help/bio.md
+++ b/content/en/showcase/ampio-help/bio.md
@@ -1,11 +1,10 @@
-
__We are Ampio.__ We design and manufacture a building automation system that provides control, comfort, safety and reliability. Visit [our page](http://ampio.com/) to learn more about our solution!
__Ampio Knowledge Base__ is a service built and maintained with Hugo. It is a self-service support platform for our customers and certified installers. It also contains a complete portfolio of our modules---building blocks of the Ampio building automation system.
The site is built by:
-* [@mgetka](https://github.com/mgetka), developer
-* [@SteynAnna](https://github.com/SteynAnna), maintainer
+- [@mgetka](https://github.com/mgetka), developer
+- [@SteynAnna](https://github.com/SteynAnna), maintainer
and other members of the Ampio team responsible for content creation.
diff --git a/content/en/showcase/ampio-help/index.md b/content/en/showcase/ampio-help/index.md
index 2daafbbe1..137244722 100644
--- a/content/en/showcase/ampio-help/index.md
+++ b/content/en/showcase/ampio-help/index.md
@@ -1,7 +1,6 @@
---
title: Ampio Knowledge Base
date: 2022-10-30
-
description: "Knowledge base for the Ampio building automation system."
siteURL: https://help.ampio.com/
---
@@ -39,7 +38,7 @@ Hugo was our first choice of SSG. The multilingualism support was the primary fe
The rich functionalities of WordPress WYSIWYG editors soon turned out to be a curse. It became burdensome to maintain formatting consistency across documents prepared by multiple contributors. When we considered Markdown, we knew that it would give us a lot less flexibility. In our case, it proved to be a blessing in disguise---the constraints imposed by the notation ensured that each document was prepared in the same way. And in the cases where Markdown was not enough, Hugo shortcodes gave us all that we needed to get the results we anticipated.
-In terms of PDF generation, we utilized [custom output formats](/templates/output-formats/) to produce intermediary document representations, which are consumed by our custom tool transforming them to TeX documents, which are finally used to produce PDF files.
+In terms of PDF generation, we utilized [custom output formats](/configuration/output-formats/) to produce intermediary document representations, which are consumed by our custom tool transforming them to TeX documents, which are finally used to produce PDF files.
Custom output formats were also used to create search indexes. The search functionality is built on the brilliant [TNTSearch](https://github.com/teamtnt/tntsearch) library. The search queries and results are handled by PHP snippets embedded into static documents handled by Hugo.
@@ -66,7 +65,7 @@ Total in 1096 ms
Very quickly it became apparent that our initial concerns about the adaptation of the workflow among contributors were grossly exaggerated. Markdown is fairly straightforward and did not cause any trouble for the contributors.
-We recommended that our colleagues use Visual Studio Code as a tool for content creation. The project’s repository tracks project-scoped configuration of the editor, which includes a set of _tasks_ allowing to run a live server from the GUI level. This is very useful for those who are easily frightened when faced with the mighty terminal.
+We recommended that our colleagues use Visual Studio Code as a tool for content creation. The project's repository tracks project-scoped configuration of the editor, which includes a set of _tasks_ allowing to run a live server from the GUI level. This is very useful for those who are easily frightened when faced with the mighty terminal.
The basic skills of the Git workflow were also easily acquired. At the end of the day, builds and deployments are fully managed by CI/CD processes, so the administration of the service drills down to reviewing and accepting merge requests in the Git frontend. As a side effect, we receive a full and clear history of contributions, which is well appreciated by our quality assurance auditors.
diff --git a/content/en/showcase/bypasscensorship/bio.md b/content/en/showcase/bypasscensorship/bio.md
index 0a847df1e..a6c98f9ba 100644
--- a/content/en/showcase/bypasscensorship/bio.md
+++ b/content/en/showcase/bypasscensorship/bio.md
@@ -2,5 +2,5 @@ Bypass Censorship find and promote tools that provide Internet access to everyon
The site is built by:
-* [Leyla Avsar](https://www.leylaavsar.com/) (designer)
-* [Fredrik Jonsson](https://xdeb.net/) (dev)
+- [Leyla Avsar](https://www.leylaavsar.com/) (designer)
+- [Fredrik Jonsson](https://xdeb.net/) (dev)
diff --git a/content/en/showcase/bypasscensorship/index.md b/content/en/showcase/bypasscensorship/index.md
index 8cbda9aa6..bd1a072c0 100644
--- a/content/en/showcase/bypasscensorship/index.md
+++ b/content/en/showcase/bypasscensorship/index.md
@@ -1,10 +1,9 @@
---
title: Bypass Censorship
date: 2019-06-16
-description: "Showcase: Bypass Censorship find and promote tools that provide Internet access to everyone."
+description: 'Showcase: "Bypass Censorship find and promote tools that provide Internet access to everyone."'
siteURL: https://www.bypasscensorship.org/
byline: "[Fredrik Jonsson](https://xdeb.net/), Web developer & Linux sysadmin"
-
---
The British Broadcasting Corporation (BBC) (UK), Deutsche Welle (DW) (Germany), France Médias Monde (FMM) (France), the U.S. Agency for Global Media (USAGM) (US) and the Open Technology Fund (OTF) (US) co-sponsor the Bypass Censorship website.
diff --git a/content/en/showcase/digitalgov/bio.md b/content/en/showcase/digitalgov/bio.md
index db3ffafaf..70bb990b9 100644
--- a/content/en/showcase/digitalgov/bio.md
+++ b/content/en/showcase/digitalgov/bio.md
@@ -1,2 +1 @@
-
**Digital.gov** helps people in the U.S. government deliver better, more accessible digital services through publishing essential guidance, resources, tools, and online events that make it easier for people to design, build, and deliver essential services for the public.
diff --git a/content/en/showcase/digitalgov/index.md b/content/en/showcase/digitalgov/index.md
index 3db2c608f..7f0584712 100644
--- a/content/en/showcase/digitalgov/index.md
+++ b/content/en/showcase/digitalgov/index.md
@@ -1,7 +1,7 @@
---
title: Digital.gov
date: 2020-05-01
-description: "Showcase: \"Guidance on building better digital services in government.\""
+description: 'Showcase: "Guidance on building better digital services in government."'
siteURL: https://digital.gov/
siteSource: https://github.com/gsa/digitalgov.gov
---
@@ -14,15 +14,15 @@ Digital.gov is built using the [U.S. Web Design System](https://designsystem.dig
- **Start with real user needs** — We used human-centered design methods to inform our product decisions (like qualitative user research), and gathered feedback from real users. We also continually test our assumptions with small experiments.
- **Earn trust** —We recognize that trust has to be earned every time. We are including all [required links and content](https://digital.gov/resources/required-web-content-and-links/) on our site, clearly identifying as a government site, building with modern best practices, and using HTTPS.
-- **Embrace accessibility** — [Accessibility](https://digital.gov/resources/intro-accessibility/) affects everybody, and we built it into every decision. We’re continually working to conform to Section 508 requirements, use user experience best practices, and support a wide range of devices.
-- **Promote continuity** — We started from shared solutions like USWDS and [Federalist](https://federalist.18f.gov/). We designed our site to clearly identify as a government site by including USWDS’s .gov banner, common colors and patterns, and built with modern best practices.
+- **Embrace accessibility** — [Accessibility](https://digital.gov/resources/intro-accessibility/) affects everybody, and we built it into every decision. We're continually working to conform to Section 508 requirements, use user experience best practices, and support a wide range of devices.
+- **Promote continuity** — We started from shared solutions like USWDS and [Federalist](https://federalist.18f.gov/). We designed our site to clearly identify as a government site by including USWDS's .gov banner, common colors and patterns, and built with modern best practices.
- **Listen** — We actively collect user feedback and web metrics. We use the [Digital Analytics Program](https://digital.gov/services/dap/) (DAP) and analyze the data to discover actionable insights. We make small, incremental changes to continuously improve our website by listening to readers and learning from what we hear.
_More on the [USWDS maturity model »](https://designsystem.digital.gov/maturity-model/)_
## Open tools
-We didn’t start from scratch. We built and designed the Digital.gov using many of the open-source tools and services that we develop for government here in the [Technology Transformation Services](https://www.gsa.gov/tts/) (TTS).
+We didn't start from scratch. We built and designed the Digital.gov using many of the open-source tools and services that we develop for government here in the [Technology Transformation Services](https://www.gsa.gov/tts/) (TTS).
Using services that make it possible to design, build, and iterate quickly are essential to modern web design and development, which is why [Federalist](https://federalist.18f.gov/) and the [U.S. Web Design System](https://designsystem.digital.gov/) are such a great combination.
diff --git a/content/en/showcase/fireship/bio.md b/content/en/showcase/fireship/bio.md
index faf739bfa..2a5639aa7 100644
--- a/content/en/showcase/fireship/bio.md
+++ b/content/en/showcase/fireship/bio.md
@@ -1,6 +1,5 @@
-
**Fireship.io** is an ecosystem of detailed and practical resources for developers who want to build and ship high-quality apps.
The site is built by:
-* [Jeff Delaney](https://fireship.io/contributors/jeff-delaney/)
+- [Jeff Delaney](https://fireship.io/contributors/jeff-delaney/)
diff --git a/content/en/showcase/fireship/index.md b/content/en/showcase/fireship/index.md
index a229e4f6a..454ee87d7 100644
--- a/content/en/showcase/fireship/index.md
+++ b/content/en/showcase/fireship/index.md
@@ -1,7 +1,7 @@
---
title: fireship.io
date: 2019-02-02
-description: "Showcase: \"Hugo helps us create complex technical content that integrates engaging web components\""
+description: 'Showcase: "Hugo helps us create complex technical content that integrates engaging web components."'
siteURL: https://fireship.io
siteSource: https://github.com/fireship-io/fireship.io
byline: "[Jeff Delaney](https://github.com/codediodeio), Fireship.io Creator"
diff --git a/content/en/showcase/forestry/bio.md b/content/en/showcase/forestry/bio.md
index 0b8f28743..23951a1c6 100644
--- a/content/en/showcase/forestry/bio.md
+++ b/content/en/showcase/forestry/bio.md
@@ -1,4 +1,3 @@
-
Forestry.io is a Git-backed CMS (content management system) for websites and web products built using static site generators such as Hugo.
Forestry bridges the gap between developers and their teams, by making development fun and easy, while providing powerful content management for their teams.
diff --git a/content/en/showcase/forestry/index.md b/content/en/showcase/forestry/index.md
index fabcb7cd3..5b8872316 100644
--- a/content/en/showcase/forestry/index.md
+++ b/content/en/showcase/forestry/index.md
@@ -1,7 +1,7 @@
---
title: Forestry.io
date: 2018-03-16
-description: "Showcase: \"Seeing Hugo in action is a whole different world of awesome.\""
+description: 'Showcase: "Seeing Hugo in action is a whole different world of awesome."'
siteURL: https://forestry.io/
siteSource: https://github.com/forestryio/forestry.io
---
@@ -10,7 +10,7 @@ It was clear from the get-go that we had to go with a static site generator. Sta
### Why Hugo?
-In our early research we looked at Ionic’s [site](https://github.com/ionic-team/ionic) to get some inspiration. They used Jekyll to build their website. While Jekyll is a great generator, the build times for larger sites can be painfully slow. With more than 150 pages plus many custom configurations and add-ons, our website doesn’t fall into the low-volume category anymore. Our developers want a smooth experience when working on the website and our content editors need the ability to preview content quickly. In short, we need our builds to be lightning fast.
+In our early research we looked at Ionic's [site](https://github.com/ionic-team/ionic) to get some inspiration. They used Jekyll to build their website. While Jekyll is a great generator, the build times for larger sites can be painfully slow. With more than 150 pages plus many custom configurations and add-ons, our website doesn't fall into the low-volume category anymore. Our developers want a smooth experience when working on the website and our content editors need the ability to preview content quickly. In short, we need our builds to be lightning fast.
We knew Hugo was fast but we did [some additional benchmarking](https://forestry.io/blog/hugo-vs-jekyll-benchmark/) before making our decision. Seeing Hugo in action is a whole different world of awesome. Hugo takes less than one second to build our 150-page site! Take a look:
@@ -35,14 +35,14 @@ Lastly, we want to take the opportunity to give some love to other amazing tools
### What tools did we use?
-* Our Norwegian designer Nichlas is in love with [**Sketch**](https://www.sketchapp.com/). From what we hear it’s a designer’s dream come true.
-* Some say our main graphic is [mesmerizing](https://x.com/hmncllctv/status/968907474664284160). Nichlas created it using [**3DS Max**](https://www.autodesk.com/products/3ds-max/overview).
-* [**Hugo**](https://gohugo.io/) -- of course.
-* Chris can’t think of modern web development without [**Gulp**](https://gulpjs.com/) & [**Webpack**](https://webpack.js.org/). We used them to add additional build steps such as Browsersync, CSS, JS and SVG optimization.
-* Speaking about adding steps to our build, our lives would be much harder without [**CircleCI**](https://circleci.com/) for continuous deployment and automated testing purposes.
-* We can’t stop raving about [**Algolia**](https://www.algolia.com/). Chris loves it and even wrote a tutorial on [how to implement Algolia](https://forestry.io/blog/search-with-algolia-in-hugo/) into static sites using Hugo’s [Custom Outputs](/templates/output-formats/).
-* [**Cloudinary**](https://cloudinary.com/) is probably one of the easiest ways to get responsive images into your website.
-* We might be a little biased on this one - We think [**Forestry.io**](https://forestry.io/) is a great way to add a content management system with a clean UI on top of your site without interrupting your experience as a developer.
-* For hosting purposes we use the almighty [**AWS**](https://aws.amazon.com/).
-* [**Formspree.io**](https://formspree.io/) is managing our support and enterprise requests.
-* We also use browser cookies and JS to customize our user’s experience and give it a more dynamic feel.
+- Our Norwegian designer Nichlas is in love with [**Sketch**](https://www.sketchapp.com/). From what we hear it's a designer's dream come true.
+- Some say our main graphic is [mesmerizing](https://x.com/hmncllctv/status/968907474664284160). Nichlas created it using [**3DS Max**](https://www.autodesk.com/products/3ds-max/overview).
+- [**Hugo**](https://gohugo.io/) -- of course.
+- Chris can't think of modern web development without [**Gulp**](https://gulpjs.com/) & [**Webpack**](https://webpack.js.org/). We used them to add additional build steps such as Browsersync, CSS, JS and SVG optimization.
+- Speaking about adding steps to our build, our lives would be much harder without [**CircleCI**](https://circleci.com/) for continuous deployment and automated testing purposes.
+- We can't stop raving about [**Algolia**](https://www.algolia.com/). Chris loves it and even wrote a tutorial on [how to implement Algolia](https://forestry.io/blog/search-with-algolia-in-hugo/) into static sites using Hugo's [custom output formats](/configuration/output-formats/).
+- [**Cloudinary**](https://cloudinary.com/) is probably one of the easiest ways to get responsive images into your website.
+- We might be a little biased on this one - We think [**Forestry.io**](https://forestry.io/) is a great way to add a content management system with a clean UI on top of your site without interrupting your experience as a developer.
+- For hosting purposes we use the almighty [**AWS**](https://aws.amazon.com/).
+- [**Formspree.io**](https://formspree.io/) is managing our support and enterprise requests.
+- We also use browser cookies and JS to customize our user's experience and give it a more dynamic feel.
diff --git a/content/en/showcase/godot-tutorials/index.md b/content/en/showcase/godot-tutorials/index.md
index 3b71fd8bc..fe4f9337e 100644
--- a/content/en/showcase/godot-tutorials/index.md
+++ b/content/en/showcase/godot-tutorials/index.md
@@ -1,16 +1,9 @@
---
-
title: Godot Tutorials
date: 2021-01-07
-
description: "Teaching game development skills with love."
-
-# The URL to the site on the internet.
siteURL: https://godottutorials.com
-
-# Add credit to the article author. Leave blank or remove if not needed/wanted.
byline: "[Godot Tutorials](https://godottutorials.com), Web Developer & Game Programmer"
-
---
[Godot Tutorials](https://godottutorials.com) started as a way to teach beginners game programming and game development.
diff --git a/content/en/showcase/hapticmedia/index.md b/content/en/showcase/hapticmedia/index.md
index 7ca2b6cef..52c3337bf 100644
--- a/content/en/showcase/hapticmedia/index.md
+++ b/content/en/showcase/hapticmedia/index.md
@@ -1,7 +1,7 @@
---
title: Hapticmedia Blog
date: 2019-10-01
-description: "Showcase: \"A simple, but powerful, multilingual blog.\""
+description: 'Showcase: "A simple, but powerful, multilingual blog."'
siteURL: https://hapticmedia.fr/blog/en/
byline: "[Cyril Bonnet](https://github.com/monsieurnebo), Web Developer"
---
diff --git a/content/en/showcase/hartwell-insurance/bio.md b/content/en/showcase/hartwell-insurance/bio.md
index 7fab74292..4cded7beb 100644
--- a/content/en/showcase/hartwell-insurance/bio.md
+++ b/content/en/showcase/hartwell-insurance/bio.md
@@ -1,4 +1,3 @@
-
Hartwell Insurance is an insurance company set up solely to service the Broker community.
By combining **Hugo**, **Service Worker** and **Netlify**, we were able to achieve incredible global site performance.
diff --git a/content/en/showcase/hartwell-insurance/index.md b/content/en/showcase/hartwell-insurance/index.md
index 24b4e3a9f..07ee6182c 100644
--- a/content/en/showcase/hartwell-insurance/index.md
+++ b/content/en/showcase/hartwell-insurance/index.md
@@ -1,26 +1,20 @@
---
-
title: Hartwell Insurance
-
date: 2018-02-09
-
-description: "Showcase: \"Hugo + Netlify + PWA makes for a rapid website.\""
-
+description: 'Showcase: "Hugo + Netlify + PWA makes for a rapid website."'
siteURL: https://www.hartwell-insurance.com/
-
byline: "[Trys Mudford](http://www.trysmudford.com), Lead Developer, Tomango"
-
---
-We’ve just launched a shiny new website for [Hartwell Insurance](https://www.hartwell-insurance.com/) – I’m really proud of it. It was tackled in a different way to most previous Tomango site builds, using some fancy new tools and some vintage web standards.
+We've just launched a shiny new website for [Hartwell Insurance](https://www.hartwell-insurance.com/). I'm really proud of it. It was tackled in a different way to most previous Tomango site builds, using some fancy new tools and some vintage web standards.
-It’s a multi-page, single-page (!) website written in Hugo, a static site generator built with performance as a first-class feature. _I’ve outlined a load of benefits to Hugo & static sites [here](https://why-static.netlify.com/), in case you’re interested._
+It's a multi-page, single-page (!) website written in Hugo, a static site generator built with performance as a first-class feature. _I've outlined a load of benefits to Hugo & static sites [here](https://why-static.netlify.com/), in case you're interested._
-> **In essence, a static site generator pre-renders the whole site into HTML files and serves them like it’s 1995.**
+> **In essence, a static site generator pre-renders the whole site into HTML files and serves them like it's 1995.**
-There’s no Apache or Node backend that does compilation at runtime, it’s all done at the build step. This means the server; Netlify in this case, only has to do one thing – serve files. Unsurprisingly, serving simple files is VERY quick.
+There's no Apache or Node backend that does compilation at runtime, it's all done at the build step. This means the server; Netlify in this case, only has to do one thing: serve files. Unsurprisingly, serving simple files is VERY quick.
-The starter point was the [Victor Hugo](https://github.com/netlify/victor-hugo) repository that Netlify have created. It let me dive in with Hugo, PostCSS, Browsersync and ES6 without setting up any tooling myself – always a win!
+The starter point was the [Victor Hugo](https://github.com/netlify/victor-hugo) repository that Netlify have created. It let me dive in with Hugo, PostCSS, Browsersync and ES6 without setting up any tooling myself---always a win!
I then took all the content from the design file and moved it into Markdown, putting shortcodes in where necessary. This site did need a number of custom shortcodes for the presentational elements like the expanding circles and full width backgrounds. But mostly it was just clean, semantic HTML with some CSS and JS enhancement thrown in.
@@ -32,17 +26,17 @@ For the ripple effects on the section headings, I used JS to prepend a `