2021-08-11 05:28:33 +00:00
|
|
|
{{ if .Get "src" }}
|
|
|
|
{{ $image := .Page.Resources.GetMatch (printf "*%s*" (.Get "src")) }}
|
2023-12-26 00:22:55 +00:00
|
|
|
<!-- prettier-ignore -->
|
2021-08-11 05:28:33 +00:00
|
|
|
<figure{{ with .Get "class" }} class="{{ . }}"{{ end }}>
|
2022-01-12 03:21:22 +00:00
|
|
|
{{- 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
|
|
|
|
2022-01-12 03:21:22 +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 }}
|