Sorting a range based on a param contained within

I have a range of regular pages, how do I sort them based on a parameter common to all those pages?

psudo code:

{{ $filtered_set := (where site.RegularPages “Section” “=” “something”) }}
// $sorted_set = $filtered_set sorted in ascending order of $
{{ range $elem_index, $elem_val := $sorted_set }}
{{ $elem_val.Title}} //Displayed in the order sorted earlier

{{ range sort (where site.RegularPages "Section" "something") "" "asc" }}
  <h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
{{ end }}

Thanks. Worked flawlessly

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.