mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-16 23:14:36 -04:00
Update merge.md
This commit is contained in:
parent
fd0f04f69e
commit
68a956272f
@ -7,7 +7,7 @@ menu:
|
|||||||
docs:
|
docs:
|
||||||
parent: "functions"
|
parent: "functions"
|
||||||
keywords: [dictionary]
|
keywords: [dictionary]
|
||||||
signature: ["$params := merge $default_params $user_params", $params := $default_params | merge $user_params]
|
signature: ["$params := merge $default_params $user_params"]
|
||||||
workson: []
|
workson: []
|
||||||
hugoversion: "0.56.0"
|
hugoversion: "0.56.0"
|
||||||
relatedfuncs: [dict, append, reflect.IsMap, reflect.IsSlice]
|
relatedfuncs: [dict, append, reflect.IsMap, reflect.IsSlice]
|
||||||
@ -19,7 +19,7 @@ An example merging two maps.
|
|||||||
```go-html-template
|
```go-html-template
|
||||||
{{ $default_params := dict "color" "blue" "width" "50%" "height" "25%" }}
|
{{ $default_params := dict "color" "blue" "width" "50%" "height" "25%" }}
|
||||||
{{ $user_params := dict "color" "red" "extra" (dict "duration" 2) }}
|
{{ $user_params := dict "color" "red" "extra" (dict "duration" 2) }}
|
||||||
{{ $params := $default_params | merge $user_params }}
|
{{ $params := merge $default_params $user_params }}
|
||||||
```
|
```
|
||||||
|
|
||||||
Resulting __$params__:
|
Resulting __$params__:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user