feat: add alt message for archive & related contents images (#411)

This commit is contained in:
zhixuan 2021-12-05 05:05:53 +09:00 committed by GitHub
parent 72a5e956ee
commit 497643b363
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 4 deletions

View file

@ -22,6 +22,9 @@ _testmain.go
*.exe
*.test
/public
/themes
public
themes
resources
assets/jsconfig.json
.DS_Store

View file

@ -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 }}" />

View file

@ -21,7 +21,8 @@
width="{{ $Width }}"
height="{{ $Height }}"
loading="lazy"
data-key="{{ .context.Slug }}"
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 }}"/>