EDIT #2: Sorry to edit this a second time, but it does appear to actually be broken still. It is showing the pagination numbers now, but each page shows ALL posts… sort of defeating the purpose of pagination. So I would say its broken as appears below. I’ll work on it some more and try to have a working case for future reference. If anyone can help I’d greatly appreciate it. If its not fixable, I hope it will be of some minimal help to someone in the future too as a starting point.
EDIT: OK, it DOES work! I forgot to change the pagination to something low enough in which it would appear, and everything appears to be working as intended. Left here below in case someone else needs it in the future:
{{ define "main" }}
{{ $list:= (where .Site.RegularPages "Type" "blog") }}
{{ $len := (len $list) }}
<main id="site-content">
{{ $paginator := .Paginate ($list) }}
{{ range $index, $element := $list }}
<article>
<header>
<h2 class><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
<time>{{ .Date.Format "January 2, 2006" }}</time>
</header>
</article>
{{ if ne (add $index 1) $len }}
<hr>
{{ end }}
{{ end }}
{{ template "partials/pagination.html" . }}
</main>
{{ end }}
Hi, thanks! So, this does work for the purposes I’m looking for, but sadly it now also breaks the pagination that I fixed in the previous thread.
Anyway I can have both work at the same time? If I do {{ $paginator := .Paginate ($list.Pages) }}
it seems to break the site somehow whereas without the above changes the pagination previously worked flawlessly.
I’m getting closer! I hope I can get both the conditional <hr>
to work at the same time pagination is also working too.