Support using src with custom caption parameter in figure shortcode

This commit is contained in:
2025-07-27 02:34:44 -05:00
parent 8f79d2af3a
commit f371afe529

View File

@@ -2,16 +2,14 @@
{{ with .Get "src" }}
{{ with $.Page.Resources.Get . }}
{{ partial "embed-resource.html" . }}
{{ with .Title }}
<figcaption>{{ . | markdownify }}</figcaption>
{{ end }}
{{ else }}
{{ errorf "resource %q not found" . }}
{{ end }}
{{ else }}
{{ .Inner }}
{{ with or (.Get "caption") (.Get 0) }}
<figcaption>{{ . | markdownify }}</figcaption>
{{ end }}
{{ end }}
{{ with or (.Get "caption") (.Get 0) .Title }}
<figcaption>{{ . | markdownify }}</figcaption>
{{ end }}
</figure>