diff --git a/layouts/shortcodes/fig.html b/layouts/shortcodes/fig.html index 0746971..25ac8b7 100644 --- a/layouts/shortcodes/fig.html +++ b/layouts/shortcodes/fig.html @@ -4,16 +4,40 @@ {{ else if .Get "alt" }} {{ $fig.Set "caption" (.Get "alt") }} {{ end }} + +{{ $permalink := $.Page.Permalink }} +{{ $image := .Get "src" }} +{{ $image_link_absolute := (findRE "^/" $image) }}
- {{ with .Get "link"}}{{ end }} - + {{ end }} + - {{ with .Get "link"}}{{ end }} - {{ with ($fig.Get "caption") }} + width="{{ .Get "width" | default "100%"}}" + {{ with .Get "height" }}width="{{ . }}"{{ end }} /> + {{ if .Get "link"}}{{ end }} + + {{ if ($fig.Get "caption") }}
- Figure {{ $.Page.Scratch.Get "fig" }}. {{ . }} + + Figure {{ $.Page.Scratch.Get "fig" }}. {{ $fig.Get "caption" | markdownify | plainify }} + {{ if .Get "attr" }} + [{{- with .Get "attrlink"}}{{ end -}} + {{ .Get "attr" | markdownify }} + {{- if .Get "attrlink"}}{{- end }}] + {{ end }} +
{{ end }}