mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-24 15:28:54 +00:00
30a20122b7
# Conflicts: # docs/data/docs.yaml
851 B
851 B
title, description, categories, keywords, params, aliases
| title | description | categories | keywords | params | aliases | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| collections.KeyVals | Returns a KeyVals struct by pairing a given key and values. |
|
|
The primary application for this function is the definition of the namedSlices value in the options map passed to the Related method on the Pages object.
See related content.
{{ $kv := keyVals "foo" "a" "b" "c" }}
The resulting data structure is:
{
"Key": "foo",
"Values": [
"a",
"b",
"c"
]
}
To extract the key and values:
{{ $kv.Key }} → foo
{{ $kv.Values }} → [a b c]