blob: 3b91e9f1ecb92aa5e56fdac7f5b97be2f69800dd (
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
29
30
31
32
33
34
35
36
37
38
|
{{ define "main" }}
{{if .Page.Content}}
<article>
{{ .Page.Content }}
</article>
{{ else }}
{{ $paginator := .Paginate (where .Site.RegularPages.ByDate.Reverse ".Params.nolist" "<>" true ) 10 }}
{{ range $paginator.Pages }}
{{ if eq .Section "blog" }}
{{ partial "partials/blog/full-post.html" . }}
{{ else }}
{{ partial "partials/blog/cross-site-post.html" . }}
{{ end }}
{{ end }}
<nav class="blog-pages-list">
Pages:
{{ if $paginator.HasPrev }}
<span>[ <a href="{{ $paginator.Prev.URL}}">previous</a> ]</span>
{{ end }}
{{ range seq $paginator.TotalPages }}
{{ if eq . $paginator.PageNumber }}
<span class="current"> {{. }} </span>
{{ else }}
<a href="/blog/page/{{ . }}/">{{ . }}</a>
{{ end }}
{{ end }}
{{ if $paginator.HasNext }}
<span>[ <a href="{{ $paginator.Next.URL}}">Next</a> ]</span>
{{ end }}
</nav>
{{end}}
{{end}}
|