mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
5322a15ceb
Add `{{/* ... */}}` header comments to 25 partials that had no documentation,
enabling `pnpm gen:docs` to generate their reference docs. Also fix
base/head/index.html leading blank line that prevented parser matching.
Groups covered: base/, feed/, function/, home/, init/, plugin/, single/, store/, (root).
36 lines
1.4 KiB
HTML
36 lines
1.4 KiB
HTML
{{- /*
|
|
Pagination component with ellipsis.
|
|
|
|
Renders a paginated page list with ellipsis for large page counts.
|
|
Shows page numbers near the current page and ellipsis markers for distant ranges.
|
|
*/ -}}
|
|
|
|
{{- if gt .Paginator.TotalPages 1 -}}
|
|
<ul class="pagination">
|
|
{{- .Site.Store.Set "paginator.ellipsed" false -}}
|
|
{{- range $.Paginator.Pagers -}}
|
|
{{- $right := sub .TotalPages .PageNumber -}}
|
|
{{- $showNumber := or (le .PageNumber 1) (eq $right 0) -}}
|
|
{{- $showNumber := or $showNumber (and (gt .PageNumber (sub $.Paginator.PageNumber 3)) (lt .PageNumber (add $.Paginator.PageNumber 3))) -}}
|
|
{{- if $showNumber -}}
|
|
{{- $.Site.Store.Set "paginator.ellipsed" false -}}
|
|
{{- $.Site.Store.Set "paginator.shouldEllipse" false -}}
|
|
{{- else -}}
|
|
{{- $.Site.Store.Set "paginator.shouldEllipse" (not ($.Site.Store.Get "paginator.ellipsed") ) -}}
|
|
{{- $.Site.Store.Set "paginator.ellipsed" true -}}
|
|
{{- end -}}
|
|
{{- if $showNumber -}}
|
|
<li class="page-item{{ if eq . $.Paginator }} active{{ end }}">
|
|
<span class="page-link">
|
|
<a href="{{ .URL }}">{{ .PageNumber }}</a>
|
|
</span>
|
|
</li>
|
|
{{- else if ($.Site.Store.Get "paginator.shouldEllipse") -}}
|
|
<li class="page-item">
|
|
<span class="page-link" aria-hidden="true">…</span>
|
|
</li>
|
|
{{- end -}}
|
|
{{- end -}}
|
|
</ul>
|
|
{{- end -}}
|