cleanup exiting pagination ; add pagination to main page

This commit is contained in:
KemoNine 2022-12-07 14:41:25 -05:00
parent dfa8559a7a
commit ed8ddef21d
3 changed files with 5 additions and 4 deletions

View file

@ -4,7 +4,7 @@ languageCode = "en-us"
title = "KemoNine's Culinary Notebook"
theme = "gochowdown"
defaultcontentlanguage = "en"
paginate = 20
paginate = 21
canonifyurls = true
pygmentsstyle = "monokai"
pygmentscodefences = true

View file

@ -1,7 +1,7 @@
<div class="home">
<div class="recipes xs-px1 xs-mt2">
<div class="clearfix">
{{ range sort (where site.RegularPages "Type" "in" site.Params.mainSections) "Title" }}
`{{ range ( .Paginate (sort (where site.RegularPages "Type" "in" site.Params.mainSections) "Title" )).Pages }}`
<div class="sm-col sm-col-6 md-col-6 lg-col-4 xs-px1 xs-mb2">
<a class="block relative bg-blue" href="{{ .RelPermalink }}">
{{ if .Params.Image }}
@ -17,4 +17,5 @@
{{ end }}
</div>
</div>
{{ partial "pagination.html" . }}
</div>

View file

@ -9,7 +9,7 @@
{{ if ne $paginator.PageNumber 1 }}
<li><a href="{{ $paginator.First.URL }}">&laquo;</a></li>
{{ end }}
<li class="hidden"><a href="{{ $paginator.Prev.URL }}">&lsaquo;</a></li>
<li><a href="{{ $paginator.Prev.URL }}">&lsaquo;</a></li>
{{ end }}
{{ range $paginator.Pagers }}
{{ $.Scratch.Set "page_number_flag" false }}
@ -39,7 +39,7 @@
{{ end }}
{{ end }}
{{ if $paginator.HasNext }}
<li class="hidden"><a href="{{ $paginator.Next.URL }}">&rsaquo;</a></li>
<li><a href="{{ $paginator.Next.URL }}">&rsaquo;</a></li>
{{ if ne $paginator.PageNumber $paginator.TotalPages }}
<li><a href="{{ $paginator.Last.URL }}">&raquo;</a></li>
{{ end }}