fix: img attribute

add loading/decoding/fetchpriority

remove alt for decorative images
This commit is contained in:
ZhenShuo Leo
2025-09-18 13:42:22 +08:00
parent e6968d877f
commit 9eebb5b2aa
8 changed files with 21 additions and 10 deletions

View File

@@ -85,7 +85,7 @@
<figure class="not-prose flex-none relative overflow-hidden {{ $figureClasses }} thumbnail--simple">
<img
src="{{ . }}"
alt="{{ $.Title }}"
alt=""
loading="lazy"
decoding="async"
class="not-prose absolute inset-0 w-full h-full object-cover">

View File

@@ -56,7 +56,7 @@
<figure class="not-prose flex-none relative overflow-hidden thumbnail--related">
<img
src="{{ . }}"
alt="{{ $.Title }}"
alt=""
loading="lazy"
decoding="async"
fetchpriority="low"

View File

@@ -60,10 +60,9 @@
<figure class="not-prose flex-none relative overflow-hidden thumbnail--card">
<img
src="{{ . }}"
alt="{{ $.Title }}"
alt=""
loading="lazy"
decoding="async"
fetchpriority="low"
class="not-prose absolute inset-0 w-full h-full object-cover">
</figure>
{{ end }}

View File

@@ -78,7 +78,7 @@
<figure class="not-prose flex-none relative overflow-hidden {{ $figureClasses }} thumbnail--simple">
<img
src="{{ . }}"
alt="{{ $.Title }}"
alt=""
loading="lazy"
decoding="async"
class="not-prose absolute inset-0 w-full h-full object-cover">

View File

@@ -61,7 +61,10 @@
<img
id="background-image"
src="{{ . }}"
alt="Background Image"
alt=""
loading="eager"
decoding="async"
fetchpriority="high"
class="absolute inset-0 w-full h-full object-cover">
<div
class="absolute inset-0 bg-gradient-to-t from-neutral dark:from-neutral-800 to-transparent mix-blend-normal"></div>

View File

@@ -45,7 +45,7 @@
<div class="overflow-hidden h-36 md:h-56 lg:h-72">
<img
src="{{ . }}"
alt="{{ $.Title }}"
alt=""
loading="eager"
decoding="async"
fetchpriority="high"

View File

@@ -51,7 +51,13 @@
{{ with $featuredURL }}
<figure>
<img class="w-full rounded-lg single_hero_round nozoom" alt="{{ $alt }}" src="{{ . }}">
<img
src="{{ . }}"
alt="{{ $alt }}"
loading="eager"
decoding="async"
fetchpriority="high"
class="w-full rounded-lg single_hero_round nozoom">
{{ if $caption }}
<figcaption class="text-sm text-neutral-700 dark:text-neutral-400 hover:underline text-center">
{{ $caption | markdownify }}

View File

@@ -84,7 +84,7 @@
<div class="overflow-hidden rounded-md h-36 md:h-56 lg:h-72 nozoom">
<img
src="{{ . }}"
alt="{{ $.Title }}"
alt=""
loading="eager"
decoding="async"
fetchpriority="high"
@@ -98,7 +98,10 @@
<img
id="background-image-main"
src="{{ . }}"
alt="Background Image"
alt=""
loading="eager"
decoding="async"
fetchpriority="high"
class="absolute inset-0 h-full w-full object-cover">
{{ end }}
<div