From eebefd8a59687f0b3ec97cee20e254634ecb825c Mon Sep 17 00:00:00 2001 From: George Cushen Date: Fri, 19 Feb 2021 13:13:00 +0000 Subject: [PATCH] feat: add option to disable zoom in re-written Figure shortcode Compatible with previous `lightbox` option. --- wowchemy/layouts/shortcodes/figure.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wowchemy/layouts/shortcodes/figure.html b/wowchemy/layouts/shortcodes/figure.html index 681d630f..0fe0309e 100644 --- a/wowchemy/layouts/shortcodes/figure.html +++ b/wowchemy/layouts/shortcodes/figure.html @@ -3,6 +3,7 @@ {{ $destination := .Get "src" }} {{ $caption := .Get "caption" | default (.Get "title") | default "" }}{{/* Support legacy `title` option. */}} +{{ $zoom := eq (.Get "lightbox" | default "true") "true" }} {{ $id := anchorize (.Get "id" | default ($caption | plainify)) }} {{ $alt := .Get "alt" | default ($caption | plainify) }} @@ -19,7 +20,7 @@ {{ $alt }} {{ else }} {{- $img_lg := $img.Fit "1200x1200" -}} @@ -35,10 +36,10 @@ width="{{ $width }}" height="{{ $height }}" loading="lazy" - data-zoomable /> + {{ if $zoom }}data-zoomable{{end}} /> {{ end }} {{- else -}} - {{ $alt }} {{- end -}}