From f371afe5294f1edfc74df848fd4ba385a5b2842a Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Sun, 27 Jul 2025 02:34:44 -0500 Subject: [PATCH] Support using src with custom caption parameter in figure shortcode --- layouts/_shortcodes/figure.html | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/layouts/_shortcodes/figure.html b/layouts/_shortcodes/figure.html index e34f52a..6fd54bd 100644 --- a/layouts/_shortcodes/figure.html +++ b/layouts/_shortcodes/figure.html @@ -2,16 +2,14 @@ {{ with .Get "src" }} {{ with $.Page.Resources.Get . }} {{ partial "embed-resource.html" . }} - {{ with .Title }} -
{{ . | markdownify }}
- {{ end }} {{ else }} {{ errorf "resource %q not found" . }} {{ end }} {{ else }} {{ .Inner }} - {{ with or (.Get "caption") (.Get 0) }} -
{{ . | markdownify }}
- {{ end }} + {{ end }} + + {{ with or (.Get "caption") (.Get 0) .Title }} +
{{ . | markdownify }}
{{ end }}