Start on writing, but also reorganize everything
This commit is contained in:
@ -5,6 +5,6 @@
|
||||
{{ range $paginator.Pages.ByWeight }}
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
{{ template "_internal/pagination.html" . }}
|
||||
{{ partial "pagination.html" . }}
|
||||
</main>
|
||||
{{end}}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
{{ range $paginator.Pages.ByWeight }}
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
{{ template "_internal/pagination.html" . }}
|
||||
{{ partial "pagination.html" . }}
|
||||
{{ if (isset .Params "back") }}
|
||||
<div style="text-align: center;"><a href="{{ .Params.back }}" class="pulse">« back to where we left off</a></div>
|
||||
{{ end }}
|
||||
|
||||
22
themes/ally/layouts/partials/pagination.html
Normal file
22
themes/ally/layouts/partials/pagination.html
Normal file
@ -0,0 +1,22 @@
|
||||
{{ $paginator := $.Paginator }}
|
||||
{{ if gt $paginator.TotalPages 1 }}
|
||||
<nav class="paginator" aria-label="page">
|
||||
<ul class="pagination pagination-sm">
|
||||
<li class="page-item{{ if not $paginator.HasPrev }} disabled{{ end }}">
|
||||
<a class="page-link" href="{{ if $paginator.HasPrev }}{{ $paginator.Prev.URL }}{{ else }}javascript:void(0){{ end }}">⮂ Previous</a>
|
||||
</li>
|
||||
{{ if lt $paginator.TotalPages 10 }}
|
||||
{{ range $paginator.Pagers }}
|
||||
<li class="page-item{{ if eq . $paginator}} active{{ end }}">
|
||||
<a class="page-link" href="{{ .URL }}">{{ .PageNumber }}{{ if eq . $paginator}}<span class="sr-only"></span>{{ end }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
<li class="page-item too-many">Page {{ $paginator.PageNumber }} of {{ $paginator.TotalPages }}</li>
|
||||
{{ end }}
|
||||
<li class="page-item{{ if not $paginator.HasNext }} disabled{{ end }}">
|
||||
<a class="page-link" href="{{ if $paginator.HasNext }}{{ $paginator.Next.URL }}{{ else }}javascript:void(0){{ end }}">Next ⮀</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
{{ end }}
|
||||
@ -5,7 +5,7 @@
|
||||
{{ range $paginator.Pages.ByWeight }}
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
{{ template "_internal/pagination.html" . }}
|
||||
{{ partial "pagination.html" . }}
|
||||
{{ if (isset .Params "back") }}
|
||||
<div style="text-align: center;"><a href="{{ .Params.back }}" class="pulse">« back to where we left off</a></div>
|
||||
{{ end }}
|
||||
|
||||
@ -173,15 +173,20 @@ ul.pagination {
|
||||
display: block;
|
||||
margin-top: 5rem;
|
||||
text-align: center;
|
||||
font-family: 'Merriweather Sans', sans-serif;
|
||||
}
|
||||
|
||||
ul.pagination li {
|
||||
display: inline-block;
|
||||
border: 2px solid currentColor;
|
||||
padding: 2px;
|
||||
margin-right: -7px;
|
||||
}
|
||||
|
||||
ul.pagination li a {
|
||||
border: none;
|
||||
display: inline-block;
|
||||
min-width: 2rem;
|
||||
text-align: center;
|
||||
margin-right: -7px;
|
||||
}
|
||||
|
||||
ul.pagination li:last-of-type {
|
||||
@ -194,6 +199,12 @@ ul.pagination li:first-of-type {
|
||||
border-bottom-left-radius: 5px;
|
||||
}
|
||||
|
||||
ul.pagination .page-item.too-many {
|
||||
color: #666;
|
||||
margin: 0 14px 0 7px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
ul.pagination .page-item.disabled a {
|
||||
color: #666;
|
||||
border: none;
|
||||
@ -202,6 +213,7 @@ ul.pagination .page-item.disabled a {
|
||||
|
||||
ul.pagination .page-item.active a {
|
||||
text-decoration: none;
|
||||
font-style: italic;
|
||||
border: none;
|
||||
cursor: text;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user