Commits (6)
.pagination {
border-top: .5px solid $grey-2;
margin: 1rem auto 1rem;
@extend %max-width;
font-family: $serif-secondary;
padding-top: 2rem;
position: relative;
text-align: center;
span {
......@@ -35,10 +37,12 @@
}
.left {
margin-left: 10%;
left: 0;
}
.right {
margin-right: 10%;
right: 0;
}
}
......@@ -2,10 +2,21 @@
<main>
<div class="catalogue">
{{ range .Pages }}
{{ range (.Paginate .Pages).Pages }}
{{ .Render "summary" }}
{{ end }}
</div>
<div class="pagination">
{{ if .Paginator.HasPrev }}
<a href="{{ .Paginator.Prev.URL }}" class="left arrow">&#8592;</a>
{{ end }}
{{ if .Paginator.HasNext }}
<a href="{{ .Paginator.Next.URL }}" class="right arrow">&#8594;</a>
{{ end }}
<span>{{ .Paginator.PageNumber }}</span>
</div>
</main>
{{ end }}
{{ define "main" }}
<main>
<a name="top"></a>
<div class="post">
{{ partial "single/post-info.html" . }}
{{ partial "single/title.html" . }}
......@@ -56,6 +57,17 @@
{{- end -}}
</div>
<div class="pagination">
{{- if .PrevPage }}
<a href="{{ .PrevPage.URL }}" class="left arrow">&#8592;</a>
{{- end }}
{{- if .NextPage }}
<a href="{{ .NextPage.URL }}" class="right arrow">&#8594;</a>
{{- end }}
<a href="#top" class="top">Top</a>
</div>
</main>
{{ end }}
......@@ -3,10 +3,21 @@
<main>
<h1>{{ strings.FirstUpper .Data.Singular }} {{ .Title }}</h1>
<div class="catalogue">
{{ range .Pages }}
{{ range (.Paginate .Pages).Pages }}
{{ .Render "summary" }}
{{ end }}
</div>
<div class="pagination">
{{ if .Paginator.HasPrev }}
<a href="{{ .Paginator.Prev.URL }}" class="left arrow">&#8592;</a>
{{ end }}
{{ if .Paginator.HasNext }}
<a href="{{ .Paginator.Next.URL }}" class="right arrow">&#8594;</a>
{{ end }}
<span>{{ .Paginator.PageNumber }}</span>
</div>
</main>
{{ end }}
......@@ -3,11 +3,22 @@
<h1>{{ .Title }}</h1>
<div class="catalogue">
<ul>
{{- range .Pages -}}
{{- range (.Paginate .Data.Pages).Pages -}}
<li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
{{- end -}}
</ul>
</div>
<div class="pagination">
{{- if .Paginator.HasPrev -}}
<a href="{{ .Paginator.Prev.URL }}" class="left arrow">&#8592;</a>
{{- end -}}
{{- if .Paginator.HasNext -}}
<a href="{{ .Paginator.Next.URL }}" class="right arrow">&#8594;</a>
{{- end -}}
<span>{{ .Paginator.PageNumber }}</span>
</div>
</main>
{{ end }}
{{ end }}
\ No newline at end of file
......@@ -4,7 +4,12 @@
{{ partial "index/introduction.html" . }}
<div class="catalogue">
{{ range where .Pages "Section" "posts" }}
{{ $posts := (.Paginate (where .Pages "Section" "posts")).Pages }}
{{ $postsLimit := .Paginator.PageSize }}
{{ $numPosts := .Paginator.TotalNumberOfElements }}
<p>Below you can find the first {{ $postsLimit }} posts on my site. For the other {{ sub $numPosts $postsLimit }} posts, check out the <a href="/posts/">/posts/ page</a>.</p>
{{ range $posts }}
{{ .Render "summary" }}
{{ end }}
</div>
......