I am trying to show a list of the 25 most frequently used tags. This can easily be achieved in a taxonomy template like this:
{{ $tags := (first 25 (.Site.Taxonomies.tags.ByCount)) }}
{{range $tags }} {{ $cnt := .Count }}
<span class="w3-tag"><a href={{ .Page.RelPermalink }} title="All pages with tag '{{ .Page.Title }}'">{{ .Page.Title }} ({{ $cnt }})</a></span>
{{end}}
However now the top 25 Tags are in the order of their occurrence. What I am trying now is to add an additional sort onto the limited tags and print them out in alphabetical order.
How is this possible? All my trials with sort fail. It seems the $tags is already of a type page.OrderedTaxonomy. And this seems not to be sortable any more!?
Am I overlooking something?