Merge commit '5be51ac3db225d5df501ed1fa1499c41d97dbf65'

This commit is contained in:
Bjørn Erik Pedersen
2025-04-10 13:04:51 +02:00
987 changed files with 12379 additions and 14083 deletions

View File

@@ -1,24 +1,17 @@
---
title: Param
title: Param shortcode
linkTitle: 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 %}}
To override Hugo's embedded `param` shortcode, copy the [source code] to a file with the same name in the `layouts/shortcodes` directory.
[source code]: {{% eturl param %}}
{{% /note %}}
> [!note]
> To override Hugo's embedded `param` shortcode, copy the [source code] to a file with the same name in the `layouts/shortcodes` directory.
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 >}}
```text {file="content/example.md"}
---
title: Example
date: 2025-01-15T23:29:46-08:00
@@ -28,7 +21,7 @@ params:
---
We found a {{%/* param "color" */%}} shirt.
{{< /code >}}
```
Hugo renders this to:
@@ -41,3 +34,5 @@ Access nested values by [chaining](g) the [identifiers](g):
```text
{{%/* param my.nested.param */%}}
```
[source code]: {{% eturl param %}}