Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-11-11 16:37:37 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-11-11 23:55:16 +0300
commita2670bf460e10ed5de69f90abbe7c4e2b32068cf (patch)
tree3af0c55190257a9db49b91f5068429de03972e72 /docs
parent1a36ce9b0903e02a5068aed5f807ed9d21f48ece (diff)
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`