{{ define "title" }}{{ T .Data.Plural | default (humanize .Data.Plural) }} | {{ .Site.Title }}{{ end }} {{ define "content" }} {{ $taxonomies := .Data.Plural }} {{ $terms := .Data.Terms.ByCount }} {{ $type := .Type }}

{{- printf "%s%s" (T "all") (T $taxonomies | default (humanize $taxonomies)) -}}

{{ if eq $taxonomies "categories" }}
{{ range $terms }} {{ $term := .Term }} {{ $pages := .Pages }} {{ with $.Site.GetPage "taxonomy" (printf "%s/%s" $type $term) }}

 {{ $term | humanize}}

{{ range first 5 $pages }} {{ end }} {{ if gt (len $pages) 5 }} {{ T "More" }} >> {{ end }}
{{ end }} {{ end }}
{{ else if eq $taxonomies "tags" }}
{{ range $.Site.Taxonomies.tags.ByCount }} {{ .Page.Title }} ({{ .Count }}) {{end}}
{{ end }}
{{end }}