2024-11-25 09:51:32 -08:00
|
|
|
{{- $image := .resource -}}
|
|
|
|
|
|
|
|
{{-
|
|
|
|
$resizedImages := dict
|
|
|
|
"2x" ($image.Fit "960x960")
|
|
|
|
"1x" ($image.Fit "480x480")
|
|
|
|
-}}
|
|
|
|
|
|
|
|
<figure class="figure figure--image figure--small">
|
2024-11-25 15:48:04 -08:00
|
|
|
{{ if .linksToFullSizeImage -}}
|
|
|
|
<a href="{{ $image.RelPermalink }}">
|
|
|
|
{{- end -}}
|
|
|
|
<img
|
|
|
|
src="{{ (index $resizedImages "2x").RelPermalink }}"
|
|
|
|
srcset="
|
|
|
|
{{ (index $resizedImages "2x").RelPermalink }} 960w,
|
|
|
|
{{ (index $resizedImages "1x").RelPermalink }} 480w,
|
|
|
|
"
|
|
|
|
{{ with $image.Params.alt | default $image.Title }} alt="{{ . }}"{{ end }}
|
|
|
|
{{ with $image.Title }} title="{{ . }}"{{ end }}>
|
|
|
|
{{ if .linksToFullSizeImage -}}
|
|
|
|
</a>
|
|
|
|
{{- end -}}
|
|
|
|
{{ if .shouldShowTitle }}
|
|
|
|
{{ partial "page/figures/caption.html" . }}
|
|
|
|
{{ end }}
|
2024-11-25 09:51:32 -08:00
|
|
|
</figure>
|