Coding Challenge: Create array from value in array of maps in frontmatter

This is a bit of a hack, but one way would be to use the Scratch feature. Untested example:

{{ range $i, $v := .Params.versions }}
{{ with $v.id }}{{ $.Scratch.SetInMap "ids" . . }}{{ end }}
{{ end }}

{{ delimit ($.Scratch.GetSortedMapValues "ids") ", " }}
3 Likes