mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-01-22 14:35:43 -06:00
Accessibility: add alt text for big hero
This commit is contained in:
parent
6af086dd65
commit
b00813ad26
1 changed files with 4 additions and 2 deletions
|
@ -3,14 +3,16 @@
|
|||
{{- $images := .Resources.ByType "image" -}}
|
||||
{{- $featured := $images.GetMatch "*feature*" -}}
|
||||
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
|
||||
{{- $alt := .Page.Title -}}
|
||||
{{- with .Page.Params.alt }}{{ $alt = . }}{{ end -}}
|
||||
{{- with $featured -}}
|
||||
{{ if $disableImageOptimization }}
|
||||
{{ with . }}
|
||||
<img class="w-full rounded-lg single_hero_round nozoom" width="{{ .Width }}" height="{{ .Height }}" src="{{ .RelPermalink }}">
|
||||
<img class="w-full rounded-lg single_hero_round nozoom" alt="{{ $alt }}" width="{{ .Width }}" height="{{ .Height }}" src="{{ .RelPermalink }}">
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ with .Resize "1200x" }}
|
||||
<img class="w-full rounded-lg single_hero_round nozoom" width="{{ .Width }}" height="{{ .Height }}" src="{{ .RelPermalink }}">
|
||||
<img class="w-full rounded-lg single_hero_round nozoom" alt="{{ $alt }}" width="{{ .Width }}" height="{{ .Height }}" src="{{ .RelPermalink }}">
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{- end -}}
|
Loading…
Reference in a new issue