Added pages for list sites

This commit is contained in:
Myles Sappington 2020-05-14 14:01:28 -04:00
parent cd6e9195ed
commit 5286d164da
3 changed files with 48 additions and 2 deletions

View file

@ -1,7 +1,7 @@
{{ define "main" }}
<div class="section">
<dev class="section-title">{{.Section}}</dev>
{{range .Pages}}
{{ range $index, $element := .Paginator.Pages }}
<div class="list-item">
<a class="entry-title" href="{{ .URL }}">{{ .Title }}</a>
{{$page := .}}
@ -21,4 +21,5 @@
</div>
{{end}}
</div>
{{end}}
{{ partial "pagination.html" $ }}
{{end}}

View file

@ -0,0 +1,32 @@
{{ with $.Paginator }}
{{ if gt .TotalPages 1 }}
<ul class="pagination">
{{ with .Prev }}
<li class="page-item">
<a class="page-link" href="{{ .URL }}">
<i class="fas fa-chevron-left"></i>
</a>
</li>
{{ else }}
<li class="page-item">
<a class="grayed-out" href="javascript:void()">
<i class="fas fa-chevron-left"></i>
</a>
</li>
{{ end }}
{{ with .Next }}
<li class="page-item">
<a class="page-link" href="{{ .URL }}">
<i class="fas fa-chevron-right"></i>
</a>
</li>
{{ else }}
<li class="page-item">
<a class="grayed-out" href="javascript:void()">
<i class="fas fa-chevron-right"></i>
</a>
</li>
{{ end }}
</ul>
{{ end }}
{{ end }}

View file

@ -283,6 +283,19 @@ blockquote {
padding-top: 30px;
border-top: 1px solid #3D3D3D;
}
ul.pagination {
display: flex;
flex-direction: row;
justify-content: space-around;
align-items: center;
list-style-type: none;
font-size: 30px;
margin-top: 50px;
padding-top: 30px;
border-top: 1px solid #3D3D3D;
}
.nav-top:hover{
text-decoration: none;
}