fix(header): add aria-label for icons

This commit is contained in:
ZhenShuo Leo
2025-10-08 21:16:21 +08:00
parent 9a043d83ab
commit 6c8e0d7933
4 changed files with 6 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
<li class="mt-1">
<a
href="{{ .URL }}"
{{ with or .Name .Pre }}aria-label="{{ . }}"{{ end }}
class="flex items-center hover:text-primary-600 dark:hover:text-primary-400">
{{ if .Pre }}
<span {{ if and .Pre .Name }}class="mr-1"{{ end }}>
@@ -24,6 +25,7 @@
}}
target="_blank"
{{ end }}
{{ with or .Name .Pre }}aria-label="{{ . }}"{{ end }}
class="flex items-center hover:text-primary-600 dark:hover:text-primary-400">
{{ if .Pre }}
<span {{ if and .Pre .Name }}class="mr-1"{{ end }}>

View File

@@ -7,6 +7,7 @@
target="_blank"
{{ end }}
class="flex items-center hover:text-primary-600 dark:hover:text-primary-400"
{{ with or .Name .Pre }}aria-label="{{ . }}"{{ end }}
title="{{ .Title }}">
{{ if .Pre }}
<div {{ if and .Pre .Name }}class="mr-2"{{ end }}>

View File

@@ -12,6 +12,7 @@
target="_blank"
{{ end }}
{{ end }}
{{ with or .Name .Pre }}aria-label="{{ . }}"{{ end }}
class="text-base font-medium hover:text-primary-600 dark:hover:text-primary-400"
title="{{ .Title }}">
<p>
@@ -31,6 +32,7 @@
{{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }}
target="_blank"
{{ end }}
{{ with or .Name .Pre }}aria-label="{{ . }}"{{ end }}
class="flex items-center hover:text-primary-600 dark:hover:text-primary-400">
{{ if .Pre }}
<span {{ if and .Pre .Name }}class="mr-1"{{ end }}>

View File

@@ -2,6 +2,7 @@
href="{{ .URL }}"
{{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }}target="_blank"{{ end }}
class="flex items-center hover:text-primary-600 dark:hover:text-primary-400"
{{ with or .Name .Pre }}aria-label="{{ . }}"{{ end }}
title="{{ .Title }}">
{{ if .Pre }}
<span {{ if and .Pre .Name }}class="mr-1"{{ end }}>