Get
Syntax
SHORTCODE.Get PARAM
Returns
any
Specify the parameter by position or by name. When calling a shortcode within Markdown, use either positional or named parameters, but not both.
Positional parameters
This shortcode call uses positional parameters:
content/about.md
{{< myshortcode "Hello" "world" >}}
To retrieve parameters by position:
layouts/shortcodes/myshortcode.html
{{ printf "%s %s." (.Get 0) (.Get 1) }} → Hello world.
Named parameters
This shortcode call uses named parameters:
content/about.md
{{< myshortcode greeting="Hello" firstName="world" >}}
To retrieve parameters by name:
layouts/shortcodes/myshortcode.html
{{ printf "%s %s." (.Get "greeting") (.Get "firstName") }} → Hello world.