mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 10:18:40 +00:00
1 parent
4538c092c2
commit
8cc2c72ca6
1 file changed
+6
@@ -21,6 +21,12 @@ aliases: []
|
|||||||
|
|
||||||
`dict` is especially useful for passing more than one value to a partial template.
|
`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`
|
## Example: Using `dict` to pass multiple values to a `partial`
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user