From 64d9dd43e8217048c209eed394f72a7746389d57 Mon Sep 17 00:00:00 2001 From: William Cooley Date: Wed, 26 Feb 2020 13:19:44 -0500 Subject: [PATCH] use page leaf bundle image resources with figure tag --- layouts/shortcodes/figure.html | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html index 555f6bf9..c2e42cd8 100644 --- a/layouts/shortcodes/figure.html +++ b/layouts/shortcodes/figure.html @@ -10,10 +10,15 @@ {{- $thumb := .Get "src" | default (printf "%s." (.Get "thumb") | replace (.Get "link") ".") }}
-
- +
+ {{ $altText := .Get "caption" | default (.Get "alt") | default $thumb }} + {{ with $.Page.Resources.GetMatch $thumb }} + {{$altText}} + {{ end }}
- {{ with .Get "link" | default (.Get "src") }}{{ end }} + {{ with $.Page.Resources.GetMatch (.Get "link") }} + + {{ end }} {{- if or (or (.Get "title") (.Get "caption")) (.Get "attr")}}
{{- with .Get "title" }}

{{.}}

{{ end }}