From 6c8e0d7933a81a5d2b3183137c327872644297a8 Mon Sep 17 00:00:00 2001 From: ZhenShuo Leo <98386542+ZhenShuo2021@users.noreply.github.com> Date: Wed, 8 Oct 2025 21:16:21 +0800 Subject: [PATCH] fix(header): add aria-label for icons --- layouts/partials/header/header-mobile-option-nested.html | 2 ++ layouts/partials/header/header-mobile-option-simple.html | 1 + layouts/partials/header/header-option-nested.html | 2 ++ layouts/partials/header/header-option-simple.html | 1 + 4 files changed, 6 insertions(+) diff --git a/layouts/partials/header/header-mobile-option-nested.html b/layouts/partials/header/header-mobile-option-nested.html index 9670c36e..3614e496 100644 --- a/layouts/partials/header/header-mobile-option-nested.html +++ b/layouts/partials/header/header-mobile-option-nested.html @@ -1,6 +1,7 @@
  • {{ if .Pre }} @@ -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 }} diff --git a/layouts/partials/header/header-mobile-option-simple.html b/layouts/partials/header/header-mobile-option-simple.html index 7c54568e..ff6cdab5 100644 --- a/layouts/partials/header/header-mobile-option-simple.html +++ b/layouts/partials/header/header-mobile-option-simple.html @@ -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 }}
    diff --git a/layouts/partials/header/header-option-nested.html b/layouts/partials/header/header-option-nested.html index 9110f2ea..02036b77 100644 --- a/layouts/partials/header/header-option-nested.html +++ b/layouts/partials/header/header-option-nested.html @@ -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 }}">

    @@ -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 }} diff --git a/layouts/partials/header/header-option-simple.html b/layouts/partials/header/header-option-simple.html index cde2be4a..a9a87870 100644 --- a/layouts/partials/header/header-option-simple.html +++ b/layouts/partials/header/header-option-simple.html @@ -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 }}