mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-24 15:28:54 +00:00
30a20122b7
# Conflicts: # docs/data/docs.yaml
854 B
854 B
title, description, categories, keywords, params, aliases
| title | description | categories | keywords | params | aliases | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| collections.Dictionary | Returns a map created from the given key-value pairs. |
|
|
Specify the key-value pairs as individual arguments:
{{ $m := dict "a" 1 "b" 2 }}
The above produces this data structure:
{
"a": 1,
"b": 2
}
To create an empty map:
{{ $m := dict }}
Note that the key can be either a string or a []string. The latter is useful to create a deeply nested structure, e.g.:
{{ $m := dict (slice "a" "b" "c") "value" }}
The above produces this data structure:
{
"a": {
"b": {
"c": "value"
}
}
}