Split duplicated .page-list div into separate partial

This commit is contained in:
2022-05-06 21:14:42 -05:00
parent a9d1c25ee4
commit 805dc65ccb
10 changed files with 28 additions and 115 deletions

View File

@ -11,24 +11,10 @@
{{ . }}
{{ end }}
<div class="page-list">
{{ with .Paginator.Pages.Reverse }}
<ul>
{{ $i := 0 }}
{{ $total := len $.Pages }}
{{ range . }}
{{ $i = add 1 $i }}
{{ .Scratch.Set "series_position" $i }}
{{ .Scratch.Set "series_total" $total }}
<li>{{ .Render "summary/post" }}</li>
{{ end }}
</ul>
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ end }}
</div>
{{ with .Paginator.Pages.Reverse }}
{{ partial "page-list.html" . }}
{{ end }}
{{ partial "pagination.html" . }}
{{ end }}