website/themes/hugo-theme-relearn/exampleSite/content/shortcodes/siteparam.en.md
+++ description = "Get value of site params" title = "SiteParam" +++
The siteparam shortcode prints values of site params.
While the examples are using shortcodes with named parameter you are free to use positional aswell or call this shortcode from your own partials.
{{< tabs groupid="shortcode-parameter">}} {{% tab title="shortcode" %}}
{{%/* siteparam name="editURL" */%}}
{{% /tab %}} {{% tab title="shortcode (positional)" %}}
{{%/* siteparam "editURL" */%}}
{{% /tab %}} {{% tab title="partial" %}}
{{ partial "shortcodes/siteparam.html" (dict
"page" .
"name" "editURL"
)}}
{{% /tab %}} {{< /tabs >}}
| Name | Position | Default | Notes |
|---|---|---|---|
| name | 1 | <empty> | The name of the site param to be displayed. |
editURL from hugo.toml`editURL` value: {{%/* siteparam name="editURL" */%}}
editURL value: {{% siteparam name="editURL" %}}
To use formatted parameter, add this in your hugo.toml:
{{< multiconfig file=hugo >}} [markup.goldmark.renderer] unsafe = true {{< /multiconfig >}}
Now values containing Markdown will be formatted correctly.
{{< multiconfig file=hugo >}} [params] [params.siteparam.test] text = "A nested parameter <b>with</b> formatting" {{< /multiconfig >}}
Formatted parameter: {{%/* siteparam name="siteparam.test.text" */%}}
Formatted parameter: {{% siteparam name="siteparam.test.text" %}}