2022-05-11 23:35:34 +02:00
|
|
|
{{- /* lazysizes and lightgallery */ -}}
|
2020-05-28 11:05:37 +02:00
|
|
|
{{- $src := .Src -}}
|
|
|
|
{{- with dict "Path" .Src "Resources" .Resources | partial "function/resource.html" -}}
|
|
|
|
{{- $src = .RelPermalink -}}
|
|
|
|
{{- 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 }}"
|
2020-05-28 11:05:37 +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-05-28 11:05:37 +02:00
|
|
|
alt="{{ $alt }}"{{ with .Height }} height="{{ . }}"{{ end }}{{ with .Width }} width="{{ . }}"{{ 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 }}"
|
2020-05-28 11:05:37 +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 }}"
|
2020-05-28 11:05:37 +02:00
|
|
|
title="{{ .Title | default $alt }}"{{ with .Height }} height="{{ . }}"{{ end }}{{ with .Width }} width="{{ . }}"{{ end }} />
|
2020-02-24 10:00:39 +01:00
|
|
|
{{- end -}}
|