{{ define "main" }}

<section id="list">

    {{ if eq .Data.Singular "tag" }}
        <h2>#{{ .Title | lower }}</h2>
    {{ else }}
        <h2>{{ .Title }}</h2>
    {{ end }}

    {{ .Content }}

    {{ range (.Paginate (.Data.Pages.GroupByDate "2006")).PageGroups  }}

    <h3>{{ .Key }}</h3>
    <ul>
        {{ range .Pages }}
        <li>
            <a href="{{ .Permalink }}">{{ if .Draft }}{{ T "draft" }}: {{end}}{{ .Title | markdownify }}</a>
            <time class="date-meta">{{ .Date.Format "Jan 2" }}</time>
        </li>
        {{ end }}
    </ul>

    {{ end }}

</section>

{{ template "_internal/pagination.html" . }}

{{ end }}
