aboutsummaryrefslogtreecommitdiff
path: root/layouts/_default/list.html
blob: c265f913185794864ba482988fef551165528078 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{{ define "main" }}
    <article>
        <h1>{{ .Title }}</h1>
        {{ if .Content }}
            <p>{{ .Content }}</p>
        {{ end }}
        <section>
            {{ range sort (.Paginator 3).Pages "Date" "desc" }}
            <div>{{ .Render "summary" }}</div>
            {{ end }}
            {{ with .Paginator }}
            <div class="grid">
                <div class='flex'>
                {{ if .HasPrev }}
                    <a href="{{ .Prev.URL }}">prev</a>
                {{ end }}
                {{ if (or (.HasPrev) (.HasNext)) }}
                    <p>{{ .PageNumber }} of {{ .TotalPages }}</p>
                {{ end }}
                {{ if .HasNext }}
                    <a href="{{ .Next.URL }}">next</a>
                {{ end }}
                </div>
            </div>
            {{ end }}
        </section>
    </article>
{{ end }}