mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2024-11-23 10:21:46 +01:00
feat: add alt message for archive & related contents images (#411)
This commit is contained in:
parent
72a5e956ee
commit
497643b363
3 changed files with 9 additions and 4 deletions
7
exampleSite/.gitignore
vendored
7
exampleSite/.gitignore
vendored
|
@ -22,6 +22,9 @@ _testmain.go
|
||||||
*.exe
|
*.exe
|
||||||
*.test
|
*.test
|
||||||
|
|
||||||
/public
|
public
|
||||||
/themes
|
themes
|
||||||
|
resources
|
||||||
|
|
||||||
|
assets/jsconfig.json
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
<img src="{{ $Permalink }}"
|
<img src="{{ $Permalink }}"
|
||||||
width="{{ $Width }}"
|
width="{{ $Width }}"
|
||||||
height="{{ $Height }}"
|
height="{{ $Height }}"
|
||||||
|
alt="{{ .Title }}"
|
||||||
loading="lazy">
|
loading="lazy">
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<img src="{{ $image.permalink }}" loading="lazy" alt="Featured image of post {{ .Title }}" />
|
<img src="{{ $image.permalink }}" loading="lazy" alt="Featured image of post {{ .Title }}" />
|
||||||
|
|
|
@ -20,8 +20,9 @@
|
||||||
<img src="{{ $Permalink }}"
|
<img src="{{ $Permalink }}"
|
||||||
width="{{ $Width }}"
|
width="{{ $Width }}"
|
||||||
height="{{ $Height }}"
|
height="{{ $Height }}"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
data-key="{{ .context.Slug }}"
|
alt="Featured image of post {{ .context.Title }}"
|
||||||
|
{{ with .context.Slug }}data-key="{{ . }}" {{ end }}
|
||||||
data-hash="{{ $imageRaw.Data.Integrity }}">
|
data-hash="{{ $imageRaw.Data.Integrity }}">
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<img src="{{ $image.permalink }}" loading="lazy" data-key="{{ .context.Slug }}" data-hash="{{ $image.permalink }}"/>
|
<img src="{{ $image.permalink }}" loading="lazy" data-key="{{ .context.Slug }}" data-hash="{{ $image.permalink }}"/>
|
||||||
|
|
Loading…
Reference in a new issue