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.

119 lines
4.2 KiB
HTML

{{ $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 }}
<li class="page-item {{ if eq .PageNumber .First.PageNumber }} disabled {{ end }}">
<a aria-label="{{ i18n `paige_first` }}" class="page-link" href="{{ .First.URL }}"><span aria-hidden="true">&laquo;</span></a>
</li>
<li class="page-item {{ if not .Prev }} disabled {{ end }}">
<a {{ if .Prev }} aria-label="{{ i18n `paige_previous` }}" {{ end }} class="page-link" {{ with .Prev }} href="{{ .URL }}" {{ end }}>
<span aria-hidden="true">&lsaquo;</span>
</a>
</li>
<li class="page-item {{ if not .Next }} disabled {{ end }}">
<a {{ if .Next }} aria-label="{{ i18n `paige_next` }}" {{ end }} class="page-link" {{ with .Next }} href="{{ .URL }}" {{ end }}>
<span aria-hidden="true">&rsaquo;</span>
</a>
</li>
<li class="page-item {{ if eq .PageNumber .Last.PageNumber }} disabled {{ end }}">
<a aria-label="{{ i18n `paige_last` }}" class="page-link" href="{{ .Last.URL }}"><span aria-hidden="true">&raquo;</span></a>
</li>
{{ end }}
</ul>
</nav>
</div>
</div>
{{ end }}
{{ end }}
{{ $collections := slice }}
{{ $pages := $page.RegularPages | and ($page.Param "paige.subpage.disable_pages" | not) }}
{{ $sections := $page.Sections | and ($page.Param "paige.subpage.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.subpage.disable_collections" | not) }}
{{ if and (not $pages) (in (slice "taxonomy" "term") $page.Kind) }}
{{ $pages = $page.Pages }}
{{ end }}
{{ with $collections }}
<div id="paige-collections">
{{ if or $sections $pages }}
<h2 class="h5 text-center" id="paige-collections-header">{{ i18n "paige_collections" }}</h2>
{{ 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 }}
</div>
{{ end }}
{{ with $sections }}
<div id="paige-sections">
{{ if or $collections $pages }}
<h2 class="h5 text-center" id="paige-sections-header">{{ i18n "paige_sections" }}</h2>
{{ 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 }}
</div>
{{ end }}
{{ with $pages }}
<div id="paige-subpages">
{{ if or $collections $sections }}
<h2 class="h5 text-center" id="paige-subpages-header">{{ i18n "paige_pages" }}</h2>
{{ end }}
{{ $pager := $page.Paginate . }}
{{ range $pager.Pages }}
{{ partial "paige/list-item.html" . }}
{{ end }}
{{ template "pagination" (dict "page" $page "pager" $pager) }}
</div>
{{ end }}