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 }}