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 | |
parent | 72a5e956eefa9d84d46504ec65e7f417e295c13e (diff) |
feat: add alt message for archive & related contents images (#411)
-rw-r--r-- | exampleSite/.gitignore | 7 | ||||
-rw-r--r-- | layouts/partials/article-list/compact.html | 1 | ||||
-rw-r--r-- | layouts/partials/article-list/tile.html | 5 |
3 files changed, 9 insertions, 4 deletions
diff --git a/exampleSite/.gitignore b/exampleSite/.gitignore index ca4d540..6db5459 100644 --- a/exampleSite/.gitignore +++ b/exampleSite/.gitignore @@ -22,6 +22,9 @@ _testmain.go *.exe *.test -/public -/themes +public +themes +resources + +assets/jsconfig.json .DS_Store 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 }}"/> |