mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2025-07-29 04:51:36 -05:00
Support using src with custom caption parameter in figure shortcode
This commit is contained in:
@@ -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>
|
||||
|
Reference in New Issue
Block a user