Welcome to mirror list, hosted at ThFree Co, Russian Federation.

image.html « plugin « partials « layouts - github.com/dillonzq/LoveIt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8e217ba252aaaca57e25f5e5194433a14a9a7076 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{{- /* lazysizes and lightgallery.js */ -}}
{{- $loading := resources.Get "svg/loading/normal.svg" | minify -}}
{{- $small := .src_s | default .src -}}
{{- $large := .src_l | default .src -}}
{{- $alt := .alt | default (relURL .src) -}}
{{- if .linked -}}
    <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 }}>
        <img
            class="lazyload{{ with .class }} {{ . }}{{ end }}"
            src="{{ $loading.RelPermalink }}"
            data-src="{{ .src | relURL }}"
            data-srcset="{{ $small | relURL }}, {{ .src | relURL }} 1.5x, {{ $large | relURL }} 2x"
            data-sizes="auto"
            alt="{{ $alt }}"{{ with .height }} height="{{ . }}"{{ end }}{{ with .width }} width="{{ . }}"{{ end }} />
    </a>
{{- else -}}
    {{- if not .large -}}
        {{- $loading = resources.Get "svg/loading/small.svg" | minify -}}
    {{- end -}}
    <img
        class="lazyload{{ with .class }} {{ . }}{{ end }}"
        src="{{ $loading.RelPermalink }}"
        data-src="{{ .src | relURL }}"
        data-srcset="{{ $small | relURL }}, {{ .src | relURL }} 1.5x, {{ $large | relURL }} 2x"
        data-sizes="auto"
        alt="{{ $alt }}"
        title="{{ .title | default $alt }}"{{ with .height }} height="{{ . }}"{{ end }}{{ with .width }} width="{{ . }}"{{ end }} />
{{- end -}}