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 1a36ce9b09
commit a2670bf460
3 changed files with 46 additions and 14 deletions

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`