I wonder if there is some hidden gem, a function I don’t know about to efficiently merge two maps together in Hugo.
Now that returning partials are there, nothing can stop us from creating our own Go Gemplate merging « function » but I’d rather use something written in Go and tested by Hugo.
I don’t think so. We do map merges internally in Hugo (config etc), but I don’t think we have a “maps.Merge” function … Which we could add I guess… I guess it is doable in templates (using Scratch), but it gets ugly when you have to recurse.
Why would you need to return? I was talking about a partial with a “recursive inline template”; you are modifiying a map, so no need to return from that recursive … thing. But it’s much easier to do in Go.