Trying to build simple faq pages with different sections.
Build this dynamic range loop to output all ‘onderdelen’ taxonomies. And for every term in the taxonomy, I output the first 3 pages.
{{ range $name, $taxonomy := .Site.Taxonomies.onderdelen }}
<div class="w-1/3">
<h4 class="text-lg lg:text-2xl font-medium mb-4">{{ $name | humanize }} <span
class="opacity-50 text-lg">({{ $taxonomy.Count }})</span></h4>
<ul>
{{ range $name := sort $taxonomy "Weight" | first 3 }}
<li>
<a href="{{ .Permalink }}"
class="font-medium opacity-75 leading-large lg:text-lg border-b border-grey-lightest block pb-2 mb-2">
<i class="fal fa-file mr-2"></i>
{{ .Title }}</a>
</li>
{{ end }}
</ul>
</div>
{{ end }}
This is working, but I can’t find a way to sort the first 3 pages by their weight.
{{ range $name := sort $taxonomy "Weight" | first 3 }}