blob: e8a260885379c873fda45c57b963189cfd829850 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
{{ define "main" }}
{{ $paginator := (.Paginator.Pages) }}.
{{ $paginator := .Paginate (where .Data.Pages "Type" "posts") }}
{{ range $paginator.Pages }}
<article class="list">
<a href="{{ .Page.Permalink }}">
<h2>{{ .Page.Title }}</h2>
</a>
({{ .PublishDate.Format "January 2, 2006" }})
<div>
{{ .Page.Content }}
</div>
</article>
{{ end }}
<nav id="pagination">
<ul>
{{ if .Paginator.HasPrev }}<li id="page-previous"><a href="{{ .Paginator.Prev.URL }}">← Newer</a></li>{{ end }}<li id="page-number"><span>Page {{ .Paginator.PageNumber }} of {{ .Paginator.TotalPages }}</span></li>{{ if .Paginator.HasNext }}<li id="page-next"><a href="{{ .Paginator.Next.URL }}">Older →</a></li>{{ end }}
</ul>
</nav>
{{ end }}
|