{{ $page := . }} {{ $collections := slice }} {{ $sections := where $page.Pages "Kind" "section" }} {{ $pages := where $page.Pages "Kind" "in" (slice "page" "term") }} {{ range $name, $taxonomy := cond $page.IsHome site.Taxonomies slice }} {{ if gt (len $taxonomy) 0 }} {{ $collections = $collections | append $taxonomy.Page }} {{ end }} {{ end }} {{ with $collections }}
{{ if or $sections $pages }}

{{ i18n "paige_collections" }}

{{ end }} {{ range . }} {{ partial "paige/page.html" . }} {{ end }}
{{ end }} {{ with $sections }}
{{ if or $collections $pages }}

{{ i18n "paige_sections" }}

{{ end }} {{ range . }} {{ partial "paige/page.html" . }} {{ end }}
{{ end }} {{ with $pages }}
{{ if or $collections $sections }}

{{ i18n "paige_pages" }}

{{ end }} {{ $pinned := where . "Params.paige.pin" true }} {{ range $pinned.ByPublishDate.Reverse }} {{ partial "paige/page.html" . }} {{ end }} {{ $pager := false }} {{ $unpinned := complement $pinned . }} {{ $weighted := where $unpinned "Weight" "gt" 0 }} {{ if $weighted }} {{ $pager = $page.Paginate $unpinned.ByWeight }} {{ range $pager.Pages }} {{ partial "paige/page.html" . }} {{ end }} {{ else }} {{ $pager = $page.Paginate ($unpinned.GroupByPublishDate "January 2006") }} {{ $pagegroups := $pager.PageGroups }} {{ range $pagegroups }} {{ if gt (len $pagegroups) 1 }}

{{ .Key }}

{{ end }} {{ range .Pages.ByWeight }} {{ partial "paige/page.html" . }} {{ end }} {{ end }} {{ end }}
{{ if or $pager.HasPrev $pager.HasNext }}
{{ partial "paige/pagination.html" $page }}
{{ end }} {{ end }}