From 6affc7b454c6790d129575d04c13f20c564e8408 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Wed, 1 Feb 2023 09:10:35 -0800 Subject: [PATCH] Add alt text support to figures/image shortcode --- layouts/shortcodes/figures/image.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/layouts/shortcodes/figures/image.html b/layouts/shortcodes/figures/image.html index 2381112..72e8eb2 100644 --- a/layouts/shortcodes/figures/image.html +++ b/layouts/shortcodes/figures/image.html @@ -1,8 +1,9 @@ -{{ $img := (.Page.Resources.GetMatch (.Get "name")) }} -{{ $resized_img := $img.Fit "1280x1280" }} +{{- $img := (.Page.Resources.GetMatch (.Get "name")) -}} +{{- $resized_img := $img.Fit "1280x1280" -}} +{{- $altText := $img.Params.alt | default $img.Title -}}
- + {{ . }} {{ if $img.Title }}
{{ $img.Title }}