mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-12 16:34:46 -04:00
Update Params.md
This commit is contained in:
parent
e00c4eea2c
commit
cdbe19b5ba
@ -18,7 +18,6 @@ With this front matter:
|
|||||||
title = 'Annual conference'
|
title = 'Annual conference'
|
||||||
date = 2023-10-17T15:11:37-07:00
|
date = 2023-10-17T15:11:37-07:00
|
||||||
display_related = true
|
display_related = true
|
||||||
event-date = '2023'
|
|
||||||
[params.author]
|
[params.author]
|
||||||
email = 'jsmith@example.org'
|
email = 'jsmith@example.org'
|
||||||
name = 'John Smith'
|
name = 'John Smith'
|
||||||
@ -36,8 +35,9 @@ Access the custom parameters by [chaining] the [identifiers]:
|
|||||||
In the template example above, each of the keys is a valid identifier. For example, none of the keys contains a hyphen. To access a key that is not a valid identifier, use the [`index`] function:
|
In the template example above, each of the keys is a valid identifier. For example, none of the keys contains a hyphen. To access a key that is not a valid identifier, use the [`index`] function:
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{ index .Params "event-date" }} → 2023
|
{{ index .Params "key-with-hyphens" }} → 2023
|
||||||
```
|
```
|
||||||
|
|
||||||
[`index`]: /functions/collections/indexfunction
|
[`index`]: /functions/collections/indexfunction
|
||||||
[chaining]: /getting-started/glossary/#chain
|
[chaining]: /getting-started/glossary/#chain
|
||||||
[identifiers]: /getting-started/glossary/#identifier
|
[identifiers]: /getting-started/glossary/#identifier
|
||||||
|
Loading…
x
Reference in New Issue
Block a user