congo/layouts/shortcodes/screenshot.html

25 lines
671 B
HTML
Raw Normal View History

2021-08-11 05:28:33 +00:00
{{ if .Get "src" }}
{{ $image := .Page.Resources.GetMatch (printf "*%s*" (.Get "src")) }}
<figure{{ with .Get "class" }} class="{{ . }}"{{ end }}>
{{- if .Get "href" -}}
<a href="{{ .Get "href" }}">
{{- end -}}
2023-11-26 01:23:34 +00:00
{{ $altText := "" }}
{{ with .Get "alt" }}
{{ $altText = . }}
{{ else }}
{{ $altText = (.Get "caption") | markdownify | plainify }}
{{ end }}
2023-11-26 13:47:26 +00:00
{{ partial "picture.html" (dict "img" $image "alt" $altText "x2" true) }}
2023-11-26 01:23:34 +00:00
{{- if .Get "href" }}</a>{{ end -}}
{{- if .Get "caption" -}}
<figcaption>
{{- .Get "caption" | markdownify -}}
</figcaption>
{{- end }}
2021-08-11 05:28:33 +00:00
</figure>
{{ end }}