{{ define "main" }}
<content>
  {{ if .Data.Singular }}
    <h1 class="blog-filter">{{ i18n "filtering-for" }} "{{ .Title }}"</h1>
  {{ else }}
    <h1 class="blog-filter">{{ .Title }}</h1>
    {{ $t := .Site.GetPage "tags"}}
    {{ $c := .Site.GetPage "categories"}}
    <p>{{ .Pages.Len }} posts sortable by <a href="{{ $c.Permalink }}">categories</a> or <a href="{{ $t.Permalink }}">tags</a>.</p>
  {{ end }}
  <ul class="blog-posts">
    {{ range .Pages }}
    <li>
      <span>
        <i>
          <time datetime='{{ .Date.Format "2006-01-02" }}' pubdate>
            {{ .Date.Format (default "2006-01-02" .Site.Params.dateFormat) }}
          </time>
        </i>
      </span>
      {{ if .Params.link }}
        <a href="{{ .Params.link }}" target="_blank">{{ .Title }} ↪</a>
      {{ else }}
        <a href="{{ .Permalink }}">{{ .Title }}</a>
      {{ end }}
    </li>
    {{ else }}
    <li>
      {{ i18n "no-posts" }}
    </li>
    {{ end }}
  </ul>
</content>
{{ end }}
