Update merge.md

This commit is contained in:
Regis Philibert 2019-08-08 18:14:49 -04:00 committed by GitHub
parent fd0f04f69e
commit 68a956272f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,7 @@ menu:
docs:
parent: "functions"
keywords: [dictionary]
signature: ["$params := merge $default_params $user_params", $params := $default_params | merge $user_params]
signature: ["$params := merge $default_params $user_params"]
workson: []
hugoversion: "0.56.0"
relatedfuncs: [dict, append, reflect.IsMap, reflect.IsSlice]
@ -19,7 +19,7 @@ An example merging two maps.
```go-html-template
{{ $default_params := dict "color" "blue" "width" "50%" "height" "25%" }}
{{ $user_params := dict "color" "red" "extra" (dict "duration" 2) }}
{{ $params := $default_params | merge $user_params }}
{{ $params := merge $default_params $user_params }}
```
Resulting __$params__: