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" title = "KemoNine's Culinary Notebook"
theme = "gochowdown" theme = "gochowdown"
defaultcontentlanguage = "en" defaultcontentlanguage = "en"
paginate = 20 paginate = 21
canonifyurls = true canonifyurls = true
pygmentsstyle = "monokai" pygmentsstyle = "monokai"
pygmentscodefences = true pygmentscodefences = true

View file

@ -1,7 +1,7 @@
<div class="home"> <div class="home">
<div class="recipes xs-px1 xs-mt2"> <div class="recipes xs-px1 xs-mt2">
<div class="clearfix"> <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"> <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 }}"> <a class="block relative bg-blue" href="{{ .RelPermalink }}">
{{ if .Params.Image }} {{ if .Params.Image }}
@ -17,4 +17,5 @@
{{ end }} {{ end }}
</div> </div>
</div> </div>
{{ partial "pagination.html" . }}
</div> </div>

View file

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