From b00813ad26e85b86693d2ab4e2890ba3bdacd6b9 Mon Sep 17 00:00:00 2001 From: Nicolas Lorin Date: Sat, 11 Mar 2023 11:04:40 +0100 Subject: [PATCH] Accessibility: add alt text for big hero --- layouts/partials/hero/big.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/layouts/partials/hero/big.html b/layouts/partials/hero/big.html index bb96c345..cbdce5d5 100644 --- a/layouts/partials/hero/big.html +++ b/layouts/partials/hero/big.html @@ -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 . }} - + {{ $alt }} {{ end }} {{ else }} {{ with .Resize "1200x" }} - + {{ $alt }} {{ end }} {{ end }} {{- end -}} \ No newline at end of file