refactor: centralize pagination logic (#1227)
* refactor: centralize pagination logic into a new helper partial used for page titles and index display * fix: list.html does not exclude hidden pages * refactor: Simplify title generation logic
This commit is contained in:
+2
-4
@@ -1,10 +1,8 @@
|
||||
{{ define "main" }}
|
||||
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
|
||||
{{ $filtered := where $pages "Params.hidden" "!=" true }}
|
||||
{{ $pag := .Paginate ($filtered) }}
|
||||
{{- $paginator := partial "helper/paginator.html" . -}}
|
||||
|
||||
<section class="article-list">
|
||||
{{ range $index, $element := $pag.Pages }}
|
||||
{{ range $index, $element := $paginator.Pages }}
|
||||
{{ partial "article-list/default" . }}
|
||||
{{ end }}
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user