tpl/collections: Allow dict to create nested structures

Fixes #6497
This commit is contained in:
Bjørn Erik Pedersen 2019-11-11 14:37:37 +01:00
parent 5f923768a6
commit f17e67b4b5

View File

@ -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`