{{ define "main" }}
  {{ $paginator := .Paginate (where .Pages "Type" "post") }}
  {{ range $paginator.Pages }}
    <article class="post">
      <header class="post-header">
        <h1 class="post-header__title"><a class="post-header__link" href="{{ .RelPermalink }}">{{ .Title }}</a></h1>
      </header>

      <section class="post-content">
        {{ .Summary }}
        {{ if .Truncated }}
          <div>
            <br><a class="post-content__link is-readmore" title="Lese den kompletten Artikel" href="{{ .RelPermalink }}">Weiterlesen</a>
          </div>
        {{ end }}
      </section>

      <footer>
        <span class="post-footer__button">
          <i class="far fa-calendar-alt post-footer__icon"></i>
          <time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}">
            {{ .Date.Day }}. {{ index $.Site.Data.de_month (printf "%d" .Date.Month) }} {{ .Date.Year }}
          </time>
        </span>

        {{ with .Params.Author }}
            {{ $author := index $.Site.Data.authors . }}

            {{ with $.Site.GetPage (printf "/author/%s" $author.name | urlize) }}
            <span class="post-footer__button">
              <i class="fas fa-user post-footer__icon"></i>
              <a class="post-footer__link" href="{{ .RelPermalink }}" title="Alle Artikel des Autors">{{ $author.name }}</a>
            </span>
            {{ end }}
        {{ end }}

        {{ range .Param "categories" }}
          {{ $name := . }}
          <span class="post-footer__button">
            {{ with $.Site.GetPage (printf "/categories/%s" $name | urlize) }}
              <i class="fas fa-tags post-footer__icon"></i>
              <a class="post-footer__link" href="{{ .RelPermalink }}" title="Alle Artikel in '{{ $name }}'">{{ $name }}</a>
            {{ end }}
          </span>
        {{ end }}
      </footer>
    </article>
  {{ end }}
  {{ partial "pagination.html" . }}
{{ end }}
