30 lines
852 B
HTML
30 lines
852 B
HTML
|
{{- $image := .resource -}}
|
||
|
|
||
|
{{-
|
||
|
$resizedImages := dict
|
||
|
"2x" ($image.Fit "960x960")
|
||
|
"1x" ($image.Fit "480x480")
|
||
|
-}}
|
||
|
|
||
|
<figure class="figure figure--image figure--small">
|
||
|
<div class="figure__container">
|
||
|
{{ 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 }}
|
||
|
</div>
|
||
|
</figure>
|