diff options
Diffstat (limited to 'tpl/collections/init.go')
-rw-r--r-- | tpl/collections/init.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tpl/collections/init.go b/tpl/collections/init.go index 8dbef75c9..17ca16543 100644 --- a/tpl/collections/init.go +++ b/tpl/collections/init.go @@ -183,6 +183,16 @@ func init() { }, ) + ns.AddMethodMapping(ctx.Merge, + []string{"merge"}, + [][2]string{ + {`{{ dict "title" "Hugo Rocks!" | collections.Merge (dict "title" "Default Title" "description" "Yes, Hugo Rocks!") | sort }}`, + `[Yes, Hugo Rocks! Hugo Rocks!]`}, + {`{{ merge (dict "title" "Default Title" "description" "Yes, Hugo Rocks!") (dict "title" "Hugo Rocks!") | sort }}`, + `[Yes, Hugo Rocks! Hugo Rocks!]`}, + }, + ) + return ns } |