Fix pagination
parent
26bc31df07
commit
4ec5202d28
|
@ -9,7 +9,9 @@
|
||||||
</article>
|
</article>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<div class="columns is-multiline is-mobile">
|
<div class="columns is-multiline is-mobile">
|
||||||
{{ range .Paginator.Pages }}
|
<!-- Custom paginator with only blog posts -->
|
||||||
|
{{ $paginator := .Paginate (where .Site.RegularPages "FirstSection.Section" "posts") }}
|
||||||
|
{{ range $paginator.Pages }}
|
||||||
{{ if (eq .FirstSection.Section "posts")}}
|
{{ if (eq .FirstSection.Section "posts")}}
|
||||||
<div class="column is-one-third">
|
<div class="column is-one-third">
|
||||||
{{ .Render "summary" }}
|
{{ .Render "summary" }}
|
||||||
|
@ -17,7 +19,7 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
{{- partial "pagination.html" . -}}
|
{{- partial "pagination.html" $paginator -}}
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{{ $pag := $.Paginator }}
|
{{ $pag := . }}
|
||||||
{{ if gt $pag.TotalPages 1 -}}
|
{{ if gt $pag.TotalPages 1 -}}
|
||||||
<nav class="mt-5 pagination is-centered" role="navigation" aria-label="pagination">
|
<nav class="mt-5 pagination is-centered" role="navigation" aria-label="pagination">
|
||||||
{{ with $pag.First -}}
|
{{ with $pag.First -}}
|
||||||
|
|
Loading…
Reference in New Issue