{{ $page := . }} {{ define "pagination" }} {{ $params := . }} {{ $page := .page }} {{ $pager := .pager }} {{ if or $pager.HasPrev $pager.HasNext }}
{{ end }} {{ end }} {{ $collections := slice }} {{ $pages := $page.RegularPages | and ($page.Param "paige.pages.disable_pages" | not) }} {{ $sections := $page.Sections | and ($page.Param "paige.pages.disable_sections" | not) }} {{ if $page.IsHome }} {{ range $name, $taxonomy := site.Taxonomies }} {{ if $taxonomy.Page }} {{ $collections = $collections | append $taxonomy.Page }} {{ end }} {{ end }} {{ end }} {{ $collections = $collections | and ($page.Param "paige.pages.disable_collections" | not) }} {{ if and (not $pages) (in (slice "taxonomy" "term") $page.Kind) }} {{ $pages = $page.Pages }} {{ end }} {{ with $collections }}
{{ if or $sections $pages }}

{{ i18n "paige_collections" }}

{{ end }} {{ if or $sections $pages }} {{ range . }} {{ partial "paige/list-item.html" . }} {{ end }} {{ else }} {{ $pager := $page.Paginate . }} {{ range $pager.Pages }} {{ partial "paige/list-item.html" . }} {{ end }} {{ template "pagination" (dict "page" $page "pager" $pager) }} {{ end }}
{{ end }} {{ with $sections }}
{{ if or $collections $pages }}

{{ i18n "paige_sections" }}

{{ end }} {{ if $pages }} {{ range . }} {{ partial "paige/list-item.html" . }} {{ end }} {{ else }} {{ $pager := $page.Paginate . }} {{ range $pager.Pages }} {{ partial "paige/list-item.html" . }} {{ end }} {{ template "pagination" (dict "page" $page "pager" $pager) }} {{ end }}
{{ end }} {{ with $pages }}
{{ if or $collections $sections }}

{{ i18n "paige_pages" }}

{{ end }} {{ $pager := $page.Paginate . }} {{ range $pager.Pages }} {{ partial "paige/list-item.html" . }} {{ end }} {{ template "pagination" (dict "page" $page "pager" $pager) }}
{{ end }}