mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-12 18:15:31 +00:00
fix(axe): gallery alt
This commit is contained in:
1 parent
2cdf158914
commit
8c20b50361
1 file changed
+4
-4
@@ -28,9 +28,9 @@
|
||||
{{ $caption = .caption }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<a data-fancybox="gallery-{{$album}}" href="{{ .RelPermalink }}" {{ with $caption }}data-caption="{{.|markdownify|emojify|safeHTMLAttr}}"{{ end }}>
|
||||
<img data-src="{{ $image.RelPermalink }}" class="lazyload" alt="" width="{{ $image.Width }}" height="{{ $image.Height }}">{{/* Width & height (or low res src) required for lazy loading. */}}
|
||||
</a>
|
||||
<a data-fancybox="gallery-{{$album}}" href="{{ .RelPermalink }}" {{ with $caption }}data-caption="{{.|markdownify|emojify|safeHTMLAttr}}"{{ end }}>
|
||||
<img data-src="{{ $image.RelPermalink }}" class="lazyload" alt="{{ plainify $caption | default $filename }}" width="{{ $image.Width }}" height="{{ $image.Height }}">{{/* Width & height (or low res src) required for lazy loading. */}}
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
{{else}}
|
||||
@@ -48,7 +48,7 @@
|
||||
{{ end }}
|
||||
{{/* Don't lazy load image as cannot init image size from non-Hugo asset, resulting in inaccurate anchor scrolling & active link highlighting. */}}
|
||||
<a data-fancybox="gallery{{ with .album }}-{{.}}{{ end }}" {{ with .caption }}data-caption="{{.|markdownify|emojify|safeHTMLAttr}}"{{ end }} href="{{$.Scratch.Get "src"}}">
|
||||
<img src="{{$.Scratch.Get "src"}}" alt="">
|
||||
<img src="{{$.Scratch.Get "src"}}" alt="{{ plainify .caption | default .image }}">
|
||||
</a>
|
||||
{{end}}
|
||||
{{else}}
|
||||
|
||||
Reference in new issue
Block a user