diff options
Diffstat (limited to 'content/en/methods/site/Param.md')
-rw-r--r-- | content/en/methods/site/Param.md | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/content/en/methods/site/Param.md b/content/en/methods/site/Param.md new file mode 100644 index 000000000..b699ef2d4 --- /dev/null +++ b/content/en/methods/site/Param.md @@ -0,0 +1,29 @@ +--- +title: Param +description: Returns the site parameter with the given key. +categories: [] +keywords: [] +action: + 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. + +{{< code-toggle file=hugo >}} +[params] +display_toc = true +{{< /code-toggle >}} + + +```go-html-template +{{ .Site.Param "display_toc" }} → true +``` + +The above is equivalent to either of these: + +```go-html-template +{{ .Site.Params.display_toc }} +{{ index .Site.Params "display_toc" }} +``` |