Merge pull request #3 from legofarmer/master

Added pages for list sites
master
saad 2020-05-14 21:17:38 +02:00 committed by GitHub
commit c9a444da9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;
}