SiteParam

Th' siteparam shortcode prints values o' ship params.

Usage

While th' examples be us'n shorrrtcodes wit' named parameter ye be free t' use positional as well or call this shortcode from yer own partials.

{{% siteparam name="editURL" %}}
{{% siteparam "editURL" %}}
{{ partial "shortcodes/siteparam.html" (dict
  "page" .
  "name" "editURL"
)}}

Parameter

Name Posit'n Default Notes
name 1 <empty> Th' name o' th' ship param t' be displayed.

Examples

editURL from hugo.toml

`editURL` value: {{% siteparam name="editURL" %}}

editURL value: https://github.com/McShelby/hugo-theme-relearn/edit/main/exampleSite/content/${FilePath}

Nested parameter wit' Marrrkdown an' HTML formatt'n

T' use formatted parameter, add this 'n yer hugo.toml:

hugo.
[marrrkup]
  [marrrkup.goldmark]
    [marrrkup.goldmark.renderer]
      unsafe = true
marrrkup:
  goldmark:
    renderer:
      unsafe: true
{
   "markup": {
      "goldmark": {
         "renderer": {
            "unsafe": true
         }
      }
   }
}

Now values contain'n Marrrkdown will be formatted correctly.

hugo.
[params]
  [params.siteparam]
    [params.siteparam.test]
      text = 'A **nested** parameter <b>with</b> formatting'
params:
  siteparam:
    test:
      text: A **nested** parameter <b>with</b> formatt'n
{
   "params": {
      "siteparam": {
         "test": {
            "text": "A **nested** parameter \u003cb\u003ewith\u003c/b\u003e formatting"
         }
      }
   }
}
Formatted parameter: {{% siteparam name="siteparam.test.text" %}}

Formatted parameter: A nested opt'n <b>with</b> formatt'n