Files
bar/layouts/partials/pagination.html
T

38 lines
1.4 KiB
HTML
Raw Normal View History

{{- with .Paginator -}}
<nav class="flex items-center justify-center gap-4 mt-8" aria-label="Pagination">
{{- if .HasPrev -}}
<a href="{{ .Prev.URL }}" class="btn btn-ghost flex items-center gap-2">
{{- partial "icon.html" "arrow-left" -}}
Previous
</a>
{{- else -}}
<span class="btn btn-ghost opacity-30 cursor-not-allowed flex items-center gap-2">
{{- partial "icon.html" "arrow-left" -}}
Previous
</span>
{{- end -}}
<div class="flex items-center gap-2">
{{- range .Pagers -}}
<a
href="{{ .URL }}"
class="{{ if eq . $.Paginator }}w-9 h-9 rounded-full bg-gold text-[#0d0a07] font-semibold font-mono text-sm flex items-center justify-center{{ else }}w-9 h-9 rounded-full border border-warm/10 text-ink-mute hover:border-gold hover:text-gold font-mono text-sm flex items-center justify-center transition-colors{{ end }}"
aria-current="{{ if eq . $.Paginator }}page{{ end }}"
>{{ .PageNumber }}</a>
{{- end -}}
</div>
{{- if .HasNext -}}
<a href="{{ .Next.URL }}" class="btn btn-ghost flex items-center gap-2">
Next
{{- partial "icon.html" "arrow-right" -}}
</a>
{{- else -}}
<span class="btn btn-ghost opacity-30 cursor-not-allowed flex items-center gap-2">
Next
{{- partial "icon.html" "arrow-right" -}}
</span>
{{- end -}}
</nav>
{{- end -}}