{{- define "title" -}}
  {{- .Params.Title | default (T .Data.Plural) | default .Data.Plural | dict "Some" | T "allSome" -}}
  {{- if .Site.Params.withSiteTitle }} {{ .Site.Params.titleDelimiter }} {{ .Site.Title }}{{- end -}}
{{- end -}}

{{- define "content" -}}
  {{- $taxonomies := .Data.Plural -}}
  {{- $iconMap := dict
    "categories" "fa-solid fa-folder-tree"
    "collections" "fa-solid fa-layer-group"
    "tags" "fa-solid fa-tags"
  -}}
  {{- $icon := index $iconMap $taxonomies | default $iconMap.categories -}}

  <div class="page archive">
    {{- /* Title */ -}}
    <h1 class="single-title animate__animated animate__pulse animate__faster">
      {{- dict "Class" (add $icon " me-1") | partial "plugin/icon.html" -}}
      {{- .Params.Title | default (T $taxonomies) | default $taxonomies | dict "Some" | T "allSome" }} <sup>{{ len .Data.Terms.ByCount }}</sup>
    </h1>
    {{- /* Render different taxonomies */ -}}
    {{- $template := cond ( eq $taxonomies "tags") "tags" "taxonomies" -}}
    {{- .Render $template -}}
  </div>
{{- end -}}
