mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-18 15:16:45 -05:00
5fd1e74903
``` git subtree add --prefix=docs/ https://github.com/gohugoio/hugoDocs.git master --squash ``` Closes #11925
820 B
820 B
title | description | categories | keywords | action | aliases | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
collections.KeyVals | Returns a KeyVals struct. |
|
|
The primary application for this function is the definition of the namedSlices
parameter 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]