2022-05-11 23:35:34 +02:00
|
|
|
{{- /* lazysizes and lightgallery */ -}}
|
2020-05-28 11:05:37 +02:00
|
|
|
{{- $src := .Src -}}
|
2022-05-12 20:01:35 +02:00
|
|
|
{{- $width := .Width -}}
|
|
|
|
{{- $height := .Height -}}
|
|
|
|
{{- with dict "Path" $src "Resources" .Resources | partial "function/resource.html" -}}
|
2020-05-28 11:05:37 +02:00
|
|
|
{{- $src = .RelPermalink -}}
|
2022-05-12 20:01:35 +02:00
|
|
|
{{- $width = $width | default .Width -}}
|
|
|
|
{{- $height = $height | default .Height -}}
|
2020-05-28 11:05:37 +02:00
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- $small := .SrcSmall | default $src -}}
|
|
|
|
{{- with dict "Path" .SrcSmall "Resources" .Resources | partial "function/resource.html" -}}
|
|
|
|
{{- $small = .RelPermalink -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- $large := .SrcLarge | default $src -}}
|
|
|
|
{{- with dict "Path" .SrcLarge "Resources" .Resources | partial "function/resource.html" -}}
|
|
|
|
{{- $large = .RelPermalink -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- $alt := .Alt | default $src -}}
|
|
|
|
{{- $loading := resources.Get "svg/loading.svg" | minify -}}
|
|
|
|
{{- if .Linked -}}
|
|
|
|
<a class="lightgallery" href="{{ $large | safeURL }}" title="{{ .Title | default $alt }}" data-thumbnail="{{ $small | safeURL }}"{{ with .Caption }} data-sub-html="<h2>{{ . }}</h2>{{ with $.Title }}<p>{{ . }}</p>{{ end }}"{{ end }}{{ with .Rel }} rel="{{ . }}"{{ end }}>
|
2020-02-24 10:00:39 +01:00
|
|
|
<img
|
2020-05-28 11:05:37 +02:00
|
|
|
class="lazyload{{ with .Class }} {{ . }}{{ end }}"
|
2020-04-22 15:34:38 +02:00
|
|
|
src="{{ $loading.RelPermalink }}"
|
2022-05-12 20:01:35 +02:00
|
|
|
data-src="{{ $src | safeURL }}"
|
|
|
|
data-srcset="{{ $small | safeURL }}, {{ $src | safeURL }} 1.5x, {{ $large | safeURL }} 2x"
|
2020-05-01 17:29:24 +02:00
|
|
|
data-sizes="auto"
|
2022-05-12 20:01:35 +02:00
|
|
|
alt="{{ $alt }}"
|
|
|
|
{{- with $width }} width="{{ . }}"{{ end }}
|
|
|
|
{{- with $height }} height="{{ . }}"{{ end }} />
|
2020-02-24 10:00:39 +01:00
|
|
|
</a>
|
|
|
|
{{- else -}}
|
|
|
|
<img
|
2020-05-28 11:05:37 +02:00
|
|
|
class="lazyload{{ with .Class }} {{ . }}{{ end }}"
|
2020-04-26 17:00:29 +02:00
|
|
|
src="{{ $loading.RelPermalink }}"
|
2022-05-12 20:01:35 +02:00
|
|
|
data-src="{{ $src | safeURL }}"
|
|
|
|
data-srcset="{{ $small | safeURL }}, {{ $src | safeURL }} 1.5x, {{ $large | safeURL }} 2x"
|
2020-05-01 17:29:24 +02:00
|
|
|
data-sizes="auto"
|
2020-03-19 05:35:37 +01:00
|
|
|
alt="{{ $alt }}"
|
2022-05-12 20:01:35 +02:00
|
|
|
title="{{ .Title | default $alt }}"
|
|
|
|
{{- with $width }} width="{{ . }}"{{ end }}
|
|
|
|
{{- with $height }} height="{{ . }}"{{ end }} />
|
2020-02-24 10:00:39 +01:00
|
|
|
{{- end -}}
|