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