accessibility: fix prohibited ARIA attributes for disabled previous page & next page elements (#1312)

accessibility: fix prohibited ARIA attributes for previous and next page button, if they are disabled

Co-authored-by: Jimmy Cai <jimmy@cai.im>
This commit is contained in:
Miriam Müller
2026-04-26 15:42:06 +02:00
committed by GitHub
co-authored by Jimmy Cai
parent e55168d873
commit 96202fea2b
+6 -2
View File
@@ -18,8 +18,10 @@
{{- /* Previous page button */ -}}
<a
class="page-link {{ if not $pag.Prev }}disabled{{ end }}"
{{- if $pag.Prev -}}href="{{ $pag.Prev.URL }}"{{- end -}}
{{- if $pag.Prev -}}
href="{{ $pag.Prev.URL }}"
aria-label="Previous page"
{{- end -}}
{{- if not $pag.Prev -}}aria-disabled="true"{{- end -}}>
{{ partial "helper/icon" "chevron-left" }}
</a>
@@ -101,8 +103,10 @@
{{- /* Next page button */ -}}
<a
class="page-link {{ if not $pag.Next }}disabled{{ end }}"
{{- if $pag.Next -}}href="{{ $pag.Next.URL }}"{{- end -}}
{{- if $pag.Next -}}
href="{{ $pag.Next.URL }}"
aria-label="Next page"
{{- end -}}
{{- if not $pag.Next -}}aria-disabled="true"{{- end -}}>
{{ partial "helper/icon" "chevron-right" }}
</a>