summaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2019-11-11 14:37:37 +0100
committerBjørn Erik Pedersen <[email protected]>2019-11-11 21:55:16 +0100
commita2670bf460e10ed5de69f90abbe7c4e2b32068cf (patch)
tree3af0c55190257a9db49b91f5068429de03972e72 /docs
parent1a36ce9b0903e02a5068aed5f807ed9d21f48ece (diff)
downloadhugo-a2670bf460e10ed5de69f90abbe7c4e2b32068cf.tar.gz
hugo-a2670bf460e10ed5de69f90abbe7c4e2b32068cf.zip
tpl/collections: Allow dict to create nested structures
Fixes #6497
Diffstat (limited to 'docs')
-rw-r--r--docs/content/en/functions/dict.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/content/en/functions/dict.md b/docs/content/en/functions/dict.md
index 007cc30c5..76fdde284 100644
--- a/docs/content/en/functions/dict.md
+++ b/docs/content/en/functions/dict.md
@@ -21,6 +21,12 @@ aliases: []
`dict` is especially useful for passing more than one value to a partial template.
+Note that the `key` can be either a `string` or a `string slice`. The latter is useful to create a deply nested structure, e.g.:
+
+```go-text-template
+{{ $m := dict (slice "a" "b" "c") "value" }}
+```
+
## Example: Using `dict` to pass multiple values to a `partial`