-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Milestone
Description
The collections.Querify template function accepts either of the following argument forms:
{{ collections.Querify "a" 1 "b" 2 }} --> a=1&b=2
{{ collections.Querify (slice "a" 1 "b" 2) }} --> a=1&b=2
But it would convenient if we could do:
{{ collections.Querify (dict "a" 1 "b" 2) }}
For example, in our embedded youtube shortcode we:
-
Build a map of parameters
-
Convert the map into a slice with this construct:
{{ range $k, $v := $params }} {{ $s = $s | append $k }} {{ $s = $s | append $v }} {{ end }} -
Pass the slice to
collections.Querify
It would be more elegant if we could remove step 2 above.