Files
libertytoolsio/themes/hugo-book.backup/layouts/_partials/docs/pagination.html

29 lines
980 B
HTML
Raw Normal View History

{{- if .Paginator -}}
<div class="flex flex-wrap justify-between">
<span>
{{- with .Paginator.Prev }}
<a href="{{ .URL }}" class="flex align-center">
<img src="{{ partial "docs/icon" "backward" }}" class="book-icon" alt="{{ partial "docs/text/i18n" "Backward" }}" />
</a>
{{ end }}
</span>
{{ if gt (len .Paginator.Pagers) 1 }}
<span class="flex gap">
{{- $currentPageNumber := .Paginator.PageNumber -}}
{{- range $pageIndex := (slice -2 -1 0 1 2) -}}
{{- with index $.Paginator.Pagers (add $currentPageNumber $pageIndex -1) -}}
<a {{if ne $currentPageNumber .PageNumber }}href="{{ .URL }}"{{end}}>{{ .PageNumber }}</a>
{{- end -}}
{{- end -}}
</span>
{{ end }}
<span>
{{- with .Paginator.Next }}
<a href="{{ .URL }}" class="flex align-center">
<img src="{{ partial "docs/icon" "forward" }}" class="book-icon" alt="{{ partial "docs/text/i18n" "Forward" }}" />
</a>
{{ end }}
</span>
</div>
{{- end -}}