Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CaiJimmy/hugo-theme-stack.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhixuan <59254886+zhixuan2333@users.noreply.github.com>2021-12-04 23:05:53 +0300
committerGitHub <noreply@github.com>2021-12-04 23:05:53 +0300
commit497643b3633e91580d2f407469c0034ad385339e (patch)
tree4ee8800c332ec1e5d011363c448bb8559fa17164 /layouts
parent72a5e956eefa9d84d46504ec65e7f417e295c13e (diff)
feat: add alt message for archive & related contents images (#411)
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/article-list/compact.html1
-rw-r--r--layouts/partials/article-list/tile.html5
2 files changed, 4 insertions, 2 deletions
diff --git a/layouts/partials/article-list/compact.html b/layouts/partials/article-list/compact.html
index 0f5a216..376512a 100644
--- a/layouts/partials/article-list/compact.html
+++ b/layouts/partials/article-list/compact.html
@@ -29,6 +29,7 @@
<img src="{{ $Permalink }}"
width="{{ $Width }}"
height="{{ $Height }}"
+ alt="{{ .Title }}"
loading="lazy">
{{ else }}
<img src="{{ $image.permalink }}" loading="lazy" alt="Featured image of post {{ .Title }}" />
diff --git a/layouts/partials/article-list/tile.html b/layouts/partials/article-list/tile.html
index 0fbf812..4ec5d57 100644
--- a/layouts/partials/article-list/tile.html
+++ b/layouts/partials/article-list/tile.html
@@ -20,8 +20,9 @@
<img src="{{ $Permalink }}"
width="{{ $Width }}"
height="{{ $Height }}"
- loading="lazy"
- data-key="{{ .context.Slug }}"
+ loading="lazy"
+ alt="Featured image of post {{ .context.Title }}"
+ {{ with .context.Slug }}data-key="{{ . }}" {{ end }}
data-hash="{{ $imageRaw.Data.Integrity }}">
{{ else }}
<img src="{{ $image.permalink }}" loading="lazy" data-key="{{ .context.Slug }}" data-hash="{{ $image.permalink }}"/>