diff options
author | zhixuan <59254886+zhixuan2333@users.noreply.github.com> | 2021-12-04 23:05:53 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-04 23:05:53 +0300 |
commit | 497643b3633e91580d2f407469c0034ad385339e (patch) | |
tree | 4ee8800c332ec1e5d011363c448bb8559fa17164 /layouts | |
parent | 72a5e956eefa9d84d46504ec65e7f417e295c13e (diff) |
feat: add alt message for archive & related contents images (#411)
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/article-list/compact.html | 1 | ||||
-rw-r--r-- | layouts/partials/article-list/tile.html | 5 |
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 }}"/> |