From 5e0744981de50228af098814029bbb783228f4aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20Cora=C3=A7=C3=A3o?= Date: Sun, 26 May 2024 22:02:28 +0100 Subject: [PATCH] fixed https://github.com/nunocoracao/blowfish/issues/1112 --- layouts/shortcodes/figure.html | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html index 4f641f3b..cd881a31 100644 --- a/layouts/shortcodes/figure.html +++ b/layouts/shortcodes/figure.html @@ -7,13 +7,13 @@ {{ $caption := .Get "caption" }} {{ $href := .Get "href" }} {{ $class := .Get "class" }} - {{ $target := .Get "target" }} + {{ $target := .Get "target" | default "_blank" }} {{ $nozoom := .Get "nozoom" | default false }} + +
+ {{ with $href }}{{ end }} {{ if findRE "^https?" $url.Scheme }} -
- {{ $altText }} - {{ with $caption }}
{{ . | markdownify }}
{{ end }} -
+ {{ $altText }} {{ else }} {{ $resource := "" }} {{ if $.Page.Resources.GetMatch ($url.String) }} @@ -22,17 +22,15 @@ {{ $resource = resources.Get ($url.String) }} {{ end }} {{ with $resource }} -
- {{ with $href }}{{ end }} {{ if $disableImageOptimization }} {{ $altText }} {{ else }} {{ $altText }} {{ end }} - {{ if $href }}{{ end }} - {{ with $caption }}
{{ . | markdownify }}
{{ end }} -
{{ else }} -
- {{ $altText }} - {{ with $caption }}
{{ . | markdownify }}
{{ end }} -
+ {{ $altText }} {{ end }} {{ end }} + {{ with $caption }}
{{ . | markdownify }}
{{ end }} + {{ if $href }}{{ end }} +
{{ end }}