{{ if .Get "default" }} {{ template "_internal/shortcodes/figure.html" . }} {{ else }} {{ $url := urls.Parse (.Get "src") }} {{ $altText := .Get "alt" }} {{ $caption := .Get "caption" }} {{ $href := .Get "href" }} {{ $class := .Get "class" }} {{ if findRE "^https?" $url.Scheme }}
{{ $altText }} {{ with $caption }}
{{ . | markdownify }}
{{ end }}
{{ else }} {{ with $.Page.Resources.GetMatch ($url.String) }}
{{ with $href }}{{ end }} {{ $altText }} {{ if $href }}{{ end }} {{ with $caption }}
{{ . | markdownify }}
{{ end }}
{{ else }} {{ errorf `[CONGO] Shortcode "figure" error in "%s": Resource "%s" not found. Check the path is correct or remove the shortcode.` .Page.Path ($url.String) }} {{ end }} {{ end }} {{ end }}