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" }} {{ define "main" }}
<div class="section"> <div class="section">
<dev class="section-title">{{.Section}}</dev> <dev class="section-title">{{.Section}}</dev>
{{range .Pages}} {{ range $index, $element := .Paginator.Pages }}
<div class="list-item"> <div class="list-item">
<a class="entry-title" href="{{ .URL }}">{{ .Title }}</a> <a class="entry-title" href="{{ .URL }}">{{ .Title }}</a>
{{$page := .}} {{$page := .}}
@ -21,4 +21,5 @@
</div> </div>
{{end}} {{end}}
</div> </div>
{{ partial "pagination.html" $ }}
{{end}} {{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; padding-top: 30px;
border-top: 1px solid #3D3D3D; 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{ .nav-top:hover{
text-decoration: none; text-decoration: none;
} }