{{ define "main" }}
<div class="td-content">
  <main class="taxonomy-taxonomy-page">
    <h1>{{ with .Data.Singular }}{{ . | humanize }}: {{ end }}<span>{{ .Title }}</span></h1>
    <div>
      {{ .Content }}
    </div>
    <div>
      {{ range .Pages }}
        {{ $manualLink := cond (isset .Params "manuallink") .Params.manualLink ( cond (isset .Params "manuallinkrelref") (relref . .Params.manualLinkRelref) .RelPermalink) }}
        <article class="article-teaser article-type-{{ with .Type }}{{ ( urlize . ) }}{{ end }}">
          <h3><a href="{{ $manualLink }}"{{ with .Params.manualLinkTitle }} title="{{ . }}"{{ end }}{{ with .Params.manualLinkTarget }} target="{{ . }}"{{ if eq . "_blank" }} rel="noopener"{{ end }}{{ end }}>{{- .Title -}}</a></h3>
          <p>{{ .Description | markdownify }}</p>
          <header class="article-meta">
            {{ $context := . }}
            {{ if .Site.Params.Taxonomy.taxonomyPageHeader }}
              {{ range $index, $taxo := .Site.Params.Taxonomy.taxonomyPageHeader }}
                {{ partial "taxonomy_terms_article.html" (dict "context" $context "taxo" $taxo ) }}
              {{ end }}
            {{ else }}
              {{ range $taxo, $taxo_map := .Site.Taxonomies }}
                {{ partial "taxonomy_terms_article.html" (dict "context" $context "taxo" $taxo ) }}
              {{ end }}
            {{ end }}
            {{ if (and (not .Params.hide_readingtime) (.Site.Params.ui.readingtime.enable)) }}
              {{ partial "reading-time.html" . }}
            {{ end }}
          </header>
        </article>
      {{ end }}
    </div>
    <a href="{{ with .Site.GetPage (printf "/%s" ( lower .Data.Plural )) }}{{ .Permalink }}{{ end }}" class="all-taxonomy-terms">{{ humanize ( T "ui_all" ) }} {{ with .Data.Plural }}{{ . | humanize }}{{ end }}</a>
  </main>
</div>
{{ end }}