diff --git a/layouts/shortcodes/fig.html b/layouts/shortcodes/fig.html index b8e71e3..314bc45 100644 --- a/layouts/shortcodes/fig.html +++ b/layouts/shortcodes/fig.html @@ -1,15 +1,22 @@ +{{ $fig := newScratch }} +{{ if .Get "caption" }} + {{ $fig.Set "caption" (.Get "caption") }} +{{ else if .Get "alt" }} + {{ $fig.Set "caption" (.Get "alt") }} +{{ end }}
{{ with .Get "link"}}{{ end }} - - {{ if .Get "link"}}{{ end }} - {{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}} + + {{ with .Get "link"}}{{ end }} + {{ with ($fig.Get "caption") }}
- {{ with .Get "title" }} - {{ . }} - {{ end }} - {{ with (.Get "caption")}} - {{ . }} - {{ end }} + Figure {{ $.Page.Scratch.Get "fig" }}. {{ . }}
{{ end }}
+{{ .Page.Scratch.Add "fig" 1 }} +{{ $fig.Delete "caption"}} \ No newline at end of file