| 1 |
--- |
| 2 |
title: Param |
| 3 |
description: Returns the site parameter with the given key. |
| 4 |
categories: [] |
| 5 |
keywords: [] |
| 6 |
params: |
| 7 |
functions_and_methods: |
| 8 |
returnType: any |
| 9 |
signatures: [SITE.Param KEY] |
| 10 |
--- |
| 11 |
|
| 12 |
The `Param` method on a `Site` object is a convenience method to return the value of a user-defined parameter in your project configuration. |
| 13 |
|
| 14 |
{{< code-toggle file=hugo >}} |
| 15 |
[params] |
| 16 |
display_toc = true |
| 17 |
{{< /code-toggle >}} |
| 18 |
|
| 19 |
```go-html-template |
| 20 |
{{ .Site.Param "display_toc" }} → true |
| 21 |
``` |
| 22 |
|
| 23 |
The above is equivalent to either of these: |
| 24 |
|
| 25 |
```go-html-template |
| 26 |
{{ .Site.Params.display_toc }} |
| 27 |
{{ index .Site.Params "display_toc" }} |
| 28 |
``` |