You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
2.7 KiB
HTML

{{ $page := . }}
{{ $collections := slice }}
{{ $h2size := "h4" }}
{{ $manypagegroups := false }}
{{ $sections := where $page.Pages "Kind" "section" }}
{{ $pagegroups := slice }}
{{ $pager := false }}
{{ $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 }}
{{ $pinned := where $pages "Params.paige.pin" true }}
{{ $unpinned := complement $pinned $pages }}
{{ $weighted := where $unpinned "Weight" "gt" 0 }}
{{ if $weighted }}
{{ $h2size = "h5" }}
{{ $pager = $page.Paginate $unpinned.ByWeight }}
{{ else }}
{{ $pager = $page.Paginate ($unpinned.GroupByPublishDate "January 2006") }}
{{ $pagegroups = $pager.PageGroups }}
{{ $manypagegroups = gt (len $pagegroups) 1 }}
{{ if not $manypagegroups }}
{{ $h2size = "h5" }}
{{ end }}
{{ end }}
{{ with $collections }}
<div id="paige-collections">
{{ if or $sections $pages }}
<h2 class="{{ $h2size }} text-center" id="paige-collections-header">{{ i18n "paige_collections" }}</h2>
{{ end }}
{{ range . }}
{{ partial "paige/page.html" . }}
{{ end }}
</div>
{{ end }}
{{ with $sections }}
<div id="paige-sections">
{{ if or $collections $pages }}
<h2 class="{{ $h2size }} text-center" id="paige-sections-header">{{ i18n "paige_sections" }}</h2>
{{ end }}
{{ range . }}
{{ partial "paige/page.html" . }}
{{ end }}
</div>
{{ end }}
{{ with $pages }}
<div id="paige-pages">
{{ if or $collections $sections }}
<h2 class="{{ $h2size }} text-center" id="paige-pages-header">{{ i18n "paige_pages" }}</h2>
{{ end }}
{{ range $pinned.ByPublishDate.Reverse }}
{{ partial "paige/page.html" . }}
{{ end }}
{{ if $pagegroups }}
{{ range $pagegroups }}
{{ if $manypagegroups }}
<h3 class="h5 paige-date-header text-center">{{ .Key }}</h3>
{{ end }}
{{ range .Pages.ByWeight }}
{{ partial "paige/page.html" . }}
{{ end }}
{{ end }}
{{ else }}
{{ range $pager.Pages }}
{{ partial "paige/page.html" . }}
{{ end }}
{{ end }}
</div>
{{ if or $pager.HasPrev $pager.HasNext }}
<div id="paige-pagination">
<div class="d-flex justify-content-center">
{{ partial "paige/pagination.html" $page }}
</div>
</div>
{{ end }}
{{ end }}