summaryrefslogtreecommitdiff
path: root/archive/layouts/24-blog/list.html
blob: 58cb88098bee1fb8d3fea4c8a8cae54d9d0cec51 (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 .Site.RegularPages.ByDate.Reverse 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}}