|
|
|
@ -1,126 +1,150 @@
|
|
|
|
|
{{ $page := . }}
|
|
|
|
|
|
|
|
|
|
{{ define "pagination" }}
|
|
|
|
|
{{ $params := . }}
|
|
|
|
|
|
|
|
|
|
{{ $page := .page }}
|
|
|
|
|
{{ $pager := .pager }}
|
|
|
|
|
|
|
|
|
|
{{ if or $pager.HasPrev $pager.HasNext }}
|
|
|
|
|
<div id="paige-pagination">
|
|
|
|
|
<div class="d-flex justify-content-center">
|
|
|
|
|
<nav aria-label="{{ i18n `paige_page_list_navigation` }}">
|
|
|
|
|
<ul class="pagination">
|
|
|
|
|
{{ with $page.Paginator }}
|
|
|
|
|
{{ if and (ne .PageNumber .First.PageNumber) (ne .First.PageNumber .Prev.PageNumber) }}
|
|
|
|
|
<li class="page-item">
|
|
|
|
|
<a aria-label="{{ i18n `paige_first` }}" class="page-link" href="{{ .First.URL }}"><span aria-hidden="true">«</span></a>
|
|
|
|
|
</li>
|
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
|
|
{{ with .Prev }}
|
|
|
|
|
<li class="page-item">
|
|
|
|
|
<a aria-label="{{ i18n `paige_previous` }}" class="page-link" href="{{ .URL }}"><span aria-hidden="true">‹</span></a>
|
|
|
|
|
</li>
|
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
|
|
{{ with .Next }}
|
|
|
|
|
<li class="page-item">
|
|
|
|
|
<a aria-label="{{ i18n `paige_next` }}" class="page-link" href="{{ .URL }}"><span aria-hidden="true">›</span></a>
|
|
|
|
|
</li>
|
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
|
|
{{ if and (ne .PageNumber .Last.PageNumber) (ne .Last.PageNumber .Next.PageNumber) }}
|
|
|
|
|
<li class="page-item">
|
|
|
|
|
<a aria-label="{{ i18n `paige_last` }}" class="page-link" href="{{ .Last.URL }}"><span aria-hidden="true">»</span></a>
|
|
|
|
|
</li>
|
|
|
|
|
{{ end }}
|
|
|
|
|
{{ end }}
|
|
|
|
|
</ul>
|
|
|
|
|
</nav>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{{ end }}
|
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
|
|
{{ $collections := slice }}
|
|
|
|
|
{{ $h2size := "h4" }}
|
|
|
|
|
{{ $manypagegroups := false }}
|
|
|
|
|
{{ $pagegroups := slice }}
|
|
|
|
|
{{ $pager := false }}
|
|
|
|
|
{{ $pages := $page.RegularPages }}
|
|
|
|
|
{{ $sections := $page.Sections }}
|
|
|
|
|
|
|
|
|
|
{{ range $name, $taxonomy := cond $page.IsHome site.Taxonomies slice }}
|
|
|
|
|
{{ if $page.IsHome }}
|
|
|
|
|
{{ range $name, $taxonomy := site.Taxonomies }}
|
|
|
|
|
{{ if $taxonomy.Page }}
|
|
|
|
|
{{ $collections = $collections | append $taxonomy.Page }}
|
|
|
|
|
{{ end }}
|
|
|
|
|
{{ end }}
|
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
|
|
{{ if and (not $pages) (in (slice "taxonomy" "term") $page.Kind) }}
|
|
|
|
|
{{ $pages = $page.Pages }}
|
|
|
|
|
{{ 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 }}
|
|
|
|
|
{{ with $collections }}
|
|
|
|
|
{{ $ordered := slice }}
|
|
|
|
|
|
|
|
|
|
{{ if not $manypagegroups }}
|
|
|
|
|
{{ $h2size = "h5" }}
|
|
|
|
|
{{ range (.GroupBy "Weight").Reverse }}
|
|
|
|
|
{{ range (sort (.Pages.GroupBy "PublishDate") "Key").Reverse }}
|
|
|
|
|
{{ range .Pages.ByTitle }}
|
|
|
|
|
{{ $ordered = $ordered | append . }}
|
|
|
|
|
{{ end }}
|
|
|
|
|
{{ 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>
|
|
|
|
|
<h2 class="h5 text-center" id="paige-collections-header">{{ i18n "paige_collections" }}</h2>
|
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
|
|
{{ range .ByWeight }}
|
|
|
|
|
{{ if or $sections $pages }}
|
|
|
|
|
{{ range $ordered }}
|
|
|
|
|
{{ partial "paige/page.html" . }}
|
|
|
|
|
{{ end }}
|
|
|
|
|
</div>
|
|
|
|
|
{{ end }}
|
|
|
|
|
{{ else }}
|
|
|
|
|
{{ $pager := $page.Paginate $ordered }}
|
|
|
|
|
|
|
|
|
|
{{ with $sections }}
|
|
|
|
|
<div id="paige-sections">
|
|
|
|
|
{{ if or $collections $pages }}
|
|
|
|
|
<h2 class="{{ $h2size }} text-center" id="paige-sections-header">{{ i18n "paige_sections" }}</h2>
|
|
|
|
|
{{ range $pager.Pages }}
|
|
|
|
|
{{ partial "paige/page.html" . }}
|
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
|
|
{{ range .ByWeight }}
|
|
|
|
|
{{ partial "paige/page.html" . }}
|
|
|
|
|
{{ template "pagination" (dict "page" $page "pager" $pager) }}
|
|
|
|
|
{{ 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 }}
|
|
|
|
|
{{ with $sections }}
|
|
|
|
|
{{ $ordered := slice }}
|
|
|
|
|
|
|
|
|
|
{{ range $pinned.ByWeight }}
|
|
|
|
|
{{ partial "paige/page.html" . }}
|
|
|
|
|
{{ range (.GroupBy "Weight").Reverse }}
|
|
|
|
|
{{ range (sort (.Pages.GroupBy "PublishDate") "Key").Reverse }}
|
|
|
|
|
{{ range .Pages.ByTitle }}
|
|
|
|
|
{{ $ordered = $ordered | append . }}
|
|
|
|
|
{{ end }}
|
|
|
|
|
{{ end }}
|
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
|
|
{{ if $pagegroups }}
|
|
|
|
|
{{ range $pagegroups }}
|
|
|
|
|
{{ if $manypagegroups }}
|
|
|
|
|
<h3 class="h5 paige-date-header text-center">{{ .Key }}</h3>
|
|
|
|
|
<div id="paige-sections">
|
|
|
|
|
{{ if or $collections $pages }}
|
|
|
|
|
<h2 class="h5 text-center" id="paige-sections-header">{{ i18n "paige_sections" }}</h2>
|
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
|
|
{{ range .Pages.ByPublishDate.Reverse }}
|
|
|
|
|
{{ if $pages }}
|
|
|
|
|
{{ range $ordered }}
|
|
|
|
|
{{ partial "paige/page.html" . }}
|
|
|
|
|
{{ end }}
|
|
|
|
|
{{ end }}
|
|
|
|
|
{{ else }}
|
|
|
|
|
{{ $pager := $page.Paginate $ordered }}
|
|
|
|
|
|
|
|
|
|
{{ range $pager.Pages }}
|
|
|
|
|
{{ partial "paige/page.html" . }}
|
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
|
|
{{ template "pagination" (dict "page" $page "pager" $pager) }}
|
|
|
|
|
{{ end }}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{{ if or $pager.HasPrev $pager.HasNext }}
|
|
|
|
|
<div id="paige-pagination">
|
|
|
|
|
<div class="d-flex justify-content-center">
|
|
|
|
|
<nav aria-label="{{ i18n `paige_page_list_navigation` }}">
|
|
|
|
|
<ul class="pagination">
|
|
|
|
|
{{ with $page.Paginator }}
|
|
|
|
|
{{ if and (ne .PageNumber .First.PageNumber) (ne .First.PageNumber .Prev.PageNumber) }}
|
|
|
|
|
<li class="page-item">
|
|
|
|
|
<a aria-label="{{ i18n `paige_first` }}" class="page-link" href="{{ .First.URL }}"><span aria-hidden="true">«</span></a>
|
|
|
|
|
</li>
|
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
|
|
{{ with .Prev }}
|
|
|
|
|
<li class="page-item">
|
|
|
|
|
<a aria-label="{{ i18n `paige_previous` }}" class="page-link" href="{{ .URL }}"><span aria-hidden="true">‹</span></a>
|
|
|
|
|
</li>
|
|
|
|
|
{{ end }}
|
|
|
|
|
{{ with $pages }}
|
|
|
|
|
{{ $ordered := slice }}
|
|
|
|
|
|
|
|
|
|
{{ with .Next }}
|
|
|
|
|
<li class="page-item">
|
|
|
|
|
<a aria-label="{{ i18n `paige_next` }}" class="page-link" href="{{ .URL }}"><span aria-hidden="true">›</span></a>
|
|
|
|
|
</li>
|
|
|
|
|
{{ range ($pages.GroupBy "Weight").Reverse }}
|
|
|
|
|
{{ range (sort (.Pages.GroupBy "PublishDate") "Key").Reverse }}
|
|
|
|
|
{{ range .Pages.ByTitle }}
|
|
|
|
|
{{ $ordered = $ordered | append . }}
|
|
|
|
|
{{ end }}
|
|
|
|
|
{{ end }}
|
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
|
|
{{ if and (ne .PageNumber .Last.PageNumber) (ne .Last.PageNumber .Next.PageNumber) }}
|
|
|
|
|
<li class="page-item">
|
|
|
|
|
<a aria-label="{{ i18n `paige_last` }}" class="page-link" href="{{ .Last.URL }}"><span aria-hidden="true">»</span></a>
|
|
|
|
|
</li>
|
|
|
|
|
<div id="paige-pages">
|
|
|
|
|
{{ if or $collections $sections }}
|
|
|
|
|
<h2 class="h5 text-center" id="paige-pages-header">{{ i18n "paige_pages" }}</h2>
|
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
|
|
{{ $pager := $page.Paginate $ordered }}
|
|
|
|
|
|
|
|
|
|
{{ range $pager.Pages }}
|
|
|
|
|
{{ partial "paige/page.html" . }}
|
|
|
|
|
{{ end }}
|
|
|
|
|
</ul>
|
|
|
|
|
</nav>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{{ template "pagination" (dict "page" $page "pager" $pager) }}
|
|
|
|
|
</div>
|
|
|
|
|
{{ end }}
|
|
|
|
|
{{ end }}
|
|
|
|
|