congo/layouts/shortcodes/figure.html

16 lines
568 B
HTML
Raw Normal View History

{{ if .Get "default" }}
{{ template "_internal/shortcodes/figure.html" . }}
{{ else }}
2023-09-12 20:16:14 +00:00
{{ $src := .Get "src" }}
{{ $alt := .Get "alt" }}
{{ $caption := .Get "caption" }}
{{ $href := .Get "href" }}
{{ $class := .Get "class" }}
<figure{{ with $class }} class="{{ . }}"{{ end }}>
{{ with $href }}<a href="{{ . }}">{{ end }}
2023-09-12 20:16:14 +00:00
{{ partial "picture.html" (dict "context" . "src" $src "alt" $alt) }}
{{ with $href }}</a>{{ end }}
{{ with $caption }}<figcaption class="text-center">{{ . | markdownify }}</figcaption>{{ end }}
</figure>
{{ end }}