Files
bobatheme/layouts/_shortcodes/figure.html
BBaoVanC bbe76a44bb Allow backticks in figure inline caption using \bt
Workaround for multline strings bounded with backtick not supporting any
way to escape one to type it inside the string.
2025-07-30 00:43:05 -05:00

18 lines
501 B
HTML

<figure>
{{ $resource_title := "" }}
{{ with .Get "src" }}
{{ with $.Page.Resources.Get . }}
{{ $resource_title = .Title }}
{{ partial "embed-resource.html" . }}
{{ else }}
{{ errorf "resource %q not found" . }}
{{ end }}
{{ else }}
{{ .Inner }}
{{ end }}
{{ with or (.Get "caption") (.Get 0) $resource_title }}
<figcaption>{{ (replace . "\\bt" "`") | markdownify }}</figcaption>
{{ end }}
</figure>