fix: remove alt in decorative images

This commit is contained in:
ZhenShuo Leo
2025-11-24 08:20:15 +08:00
parent 1be60f89da
commit ec942b013a
7 changed files with 7 additions and 8 deletions

View File

@@ -85,7 +85,7 @@
<div class="flex-none relative overflow-hidden {{ $imgWrapperClasses }} thumbnail"> <div class="flex-none relative overflow-hidden {{ $imgWrapperClasses }} thumbnail">
<img <img
src="{{ . }}" src="{{ . }}"
alt="{{ with $target.Params.featuredImageAlt }}{{ . }}{{ else }}{{ $target.Title | emojify }}{{ end }}" role="presentation"
loading="lazy" loading="lazy"
decoding="async" decoding="async"
class="not-prose absolute inset-0 w-full h-full object-cover"> class="not-prose absolute inset-0 w-full h-full object-cover">

View File

@@ -56,7 +56,7 @@
<div class="flex-none relative overflow-hidden thumbnail_card_related"> <div class="flex-none relative overflow-hidden thumbnail_card_related">
<img <img
src="{{ . }}" src="{{ . }}"
alt="{{ $page.Title }}" role="presentation"
loading="lazy" loading="lazy"
decoding="async" decoding="async"
fetchpriority="low" fetchpriority="low"

View File

@@ -60,7 +60,7 @@
<div class="flex-none relative overflow-hidden thumbnail_card"> <div class="flex-none relative overflow-hidden thumbnail_card">
<img <img
src="{{ . }}" src="{{ . }}"
alt="{{ $page.Title | plainify }}" role="presentation"
loading="lazy" loading="lazy"
decoding="async" decoding="async"
class="not-prose absolute inset-0 w-full h-full object-cover"> class="not-prose absolute inset-0 w-full h-full object-cover">

View File

@@ -78,7 +78,7 @@
<div class="flex-none relative overflow-hidden {{ $imgWrapperClasses }} thumbnail"> <div class="flex-none relative overflow-hidden {{ $imgWrapperClasses }} thumbnail">
<img <img
src="{{ . }}" src="{{ . }}"
alt="{{ $.Params.featuredImageAlt | default ($.Title | emojify) }}" role="presentation"
loading="lazy" loading="lazy"
decoding="async" decoding="async"
class="not-prose absolute inset-0 w-full h-full object-cover"> class="not-prose absolute inset-0 w-full h-full object-cover">

View File

@@ -69,7 +69,7 @@
<img <img
id="background-image" id="background-image"
src="{{ . }}" src="{{ . }}"
alt="{{ $.Title }}" role="presentation"
loading="eager" loading="eager"
decoding="async" decoding="async"
fetchpriority="high" fetchpriority="high"

View File

@@ -53,7 +53,7 @@
<div class="overflow-hidden h-36 md:h-56 lg:h-72"> <div class="overflow-hidden h-36 md:h-56 lg:h-72">
<img <img
src="{{ . }}" src="{{ . }}"
alt="{{ with $.Params.featureimagealt }}{{ . }}{{ else }}{{ with $.Title }}Featured image for {{ . }}{{ else }}Featured image{{ end }}{{ end }}" role="presentation"
loading="eager" loading="eager"
decoding="async" decoding="async"
fetchpriority="high" fetchpriority="high"

View File

@@ -87,7 +87,7 @@
<div class="overflow-hidden rounded-md h-36 md:h-56 lg:h-72 nozoom"> <div class="overflow-hidden rounded-md h-36 md:h-56 lg:h-72 nozoom">
<img <img
src="{{ . }}" src="{{ . }}"
alt="{{ $.Title }}" role="presentation"
loading="eager" loading="eager"
decoding="async" decoding="async"
fetchpriority="high" fetchpriority="high"
@@ -107,7 +107,6 @@
<img <img
id="background-image-main" id="background-image-main"
src="{{ . }}" src="{{ . }}"
alt=""
role="presentation" role="presentation"
loading="eager" loading="eager"
decoding="async" decoding="async"