2020-02-24 10:00:39 +01:00
|
|
|
{{- /* lazysizes and lightgallery.js */ -}}
|
2020-04-18 14:54:54 +02:00
|
|
|
{{- $loading := resources.Get "svg/loading/normal.svg" | minify -}}
|
2020-02-27 13:14:40 +01:00
|
|
|
{{- $small := .src_s | default .src -}}
|
|
|
|
{{- $large := .src_l | default .src -}}
|
2020-04-22 15:34:38 +02:00
|
|
|
{{- $alt := .alt | default (relURL .src) -}}
|
2020-03-19 05:35:37 +01:00
|
|
|
{{- if .linked -}}
|
2020-04-22 15:34:38 +02:00
|
|
|
<a class="lightgallery" href="{{ $large | relURL }}" title="{{ .title | default $alt }}" data-thumbnail="{{ $small | relURL }}"{{ with .caption }} data-sub-html="<h2>{{ . }}</h2>{{ with $.alt }}<p>{{ . }}</p>{{ end }}"{{ end }}{{ with .rel }} rel="{{ . }}"{{ end }}>
|
2020-02-24 10:00:39 +01:00
|
|
|
<img
|
2020-04-23 10:49:30 +02:00
|
|
|
class="lazyload{{ with .class }} {{ . }}{{ end }}"
|
2020-04-22 15:34:38 +02:00
|
|
|
src="{{ $loading.RelPermalink }}"
|
2020-02-24 10:00:39 +01:00
|
|
|
data-sizes="auto"
|
2020-04-22 15:34:38 +02:00
|
|
|
data-srcset="{{ $small | relURL }}, {{ .src | relURL }} 1.5x, {{ $large | relURL }} 2x"
|
|
|
|
data-src="{{ .src | relURL }}"
|
2020-03-19 05:35:37 +01:00
|
|
|
alt="{{ $alt }}"{{ with .height }} height="{{ . }}"{{ end }}{{ with .width }} width="{{ . }}"{{ end }} />
|
2020-02-24 10:00:39 +01:00
|
|
|
</a>
|
|
|
|
{{- else -}}
|
2020-03-19 05:35:37 +01:00
|
|
|
{{- if not .large -}}
|
2020-04-18 14:54:54 +02:00
|
|
|
{{- $loading = resources.Get "svg/loading/small.svg" | minify -}}
|
2020-03-19 05:35:37 +01:00
|
|
|
{{- end -}}
|
2020-02-24 10:00:39 +01:00
|
|
|
<img
|
2020-04-23 10:49:30 +02:00
|
|
|
class="lazyload{{ with .class }} {{ . }}{{ end }}"
|
2020-04-26 17:00:29 +02:00
|
|
|
src="{{ $loading.RelPermalink }}"
|
2020-02-24 10:00:39 +01:00
|
|
|
data-sizes="auto"
|
2020-04-22 15:34:38 +02:00
|
|
|
data-srcset="{{ $small | relURL }}, {{ .src | relURL }} 1.5x, {{ $large | relURL }} 2x"
|
|
|
|
data-src="{{ .src | relURL }}"
|
2020-03-19 05:35:37 +01:00
|
|
|
alt="{{ $alt }}"
|
|
|
|
title="{{ .title | default $alt }}"{{ with .height }} height="{{ . }}"{{ end }}{{ with .width }} width="{{ . }}"{{ end }} />
|
2020-02-24 10:00:39 +01:00
|
|
|
{{- end -}}
|