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 }}>
|
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 }}
|
|
|
|
|
|
|
|
{{ partial "pictureDefaults.html" (dict "img" $image "alt" $altText "x2" true) }}
|
|
|
|
|
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 }}
|