List only the first 15 categories

error calling first: can’t iterate over hugolib.Taxonomy

Yeah, that’s kind of annoying.

Pack them into a slice, then it works…

{{ $p := slice }}
{{ range site.Taxonomies.categories }}
  {{ $p = $p | append .Page }}
{{ end }}

{{ range first 10 $p }}
  <a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
{{ end }}
6 Likes