From 3e6ab0cf690694d4bc4e925c012ab2c6011c5e88 Mon Sep 17 00:00:00 2001 From: "Russell J. Hewett" Date: Wed, 19 Jun 2019 18:16:35 -0400 Subject: [PATCH] feat(shortcode): add lightbox option to Figure (#1146) Example: `{{< figure src="example.png" lightbox="true" >}}` --- layouts/shortcodes/figure.html | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html index 5d5782e9..867edf78 100644 --- a/layouts/shortcodes/figure.html +++ b/layouts/shortcodes/figure.html @@ -3,10 +3,17 @@ {{ if .Get "library" }} {{ $image_src = printf "img/%s" $image_src | relURL }} {{ end }} +{{ $lightbox := eq (.Get "lightbox" | default "false") "true" }} +{{ $group := .Get "lightbox-group" | default "" }} + -{{ if .Get "link"}}{{ end }} - -{{ if .Get "link"}}{{ end }} +{{ if $lightbox }} + +{{ else if .Get "link"}} + +{{ end }} + +{{ if or $lightbox (.Get "link") }}{{ end }} {{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}} {{ $figure := split (i18n "figure" | default "Figure %d:") "%d" }}
@@ -19,4 +26,4 @@

{{ end }}
{{ end }} - \ No newline at end of file +