blob: 04053ca59f30dd045db62c12cb584ffc19964686 (
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
39
40
41
42
43
44
45
46
47
48
|
{{ define "main" }}
{{ $paginator := .Paginate ( where .Pages "Type" "post" ) 10 }}
<main aria-role="main">
<header class="homepage-header">
<h1>{{.Title}}</h1>
{{ with .Params.subtitle }}
<span class="subtitle">{{.}}</span>
{{ end }}
</header>
<div class="homepage-content">
<!-- Note that the content for index.html, as a sort of list page, will pull from content/_index.md -->
{{.Content}}
</div>
<div>
<!-- Note that .Pages is the same as .Site.RegularPages on the homepage template. -->
{{ range $paginator.Pages }}
{{ .Render "summary"}}
{{ end }}
</div>
{{ if gt $paginator.TotalPages 1 }}
{{ $current := $paginator.PageNumber }}
<div class="nav-links">
<ul class="pagination">
{{ with $paginator.First }}
<a href="{{ .URL }}" aria-label="First"><span aria-hidden="true">«</span></a>
{{ end }}
<a href="{{ if $paginator.HasPrev }}{{ $paginator.Prev.URL }}{{ end }}" aria-label="Previous"><span aria-hidden="true">Previous Page</span></a>
{{ range $paginator.Pagers }}
{{ if eq $current .PageNumber }}
<span href="{{ .URL }}">{{ .PageNumber }}</a>
{{ else }}
<a href="{{ .URL }}">{{ .PageNumber }}</a>
{{ end }}
{{ end }}
<a href="{{ if $paginator.HasNext }}{{ $paginator.Next.URL }}{{ end }}" aria-label="Next"><span aria-hidden="true">Next Page</span></a>
{{ with $paginator.Last }}
<a href="{{ .URL }}" aria-label="Last"><span aria-hidden="true">»</span></a>
{{ end }}
</ul>
</div>
{{ end }}
{{ partial "ad_double_rectangle.html" . }}
</main>
{{ end }}
|