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

image.html « shortcodes « layouts - github.com/josephhutch/aether.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 32f2fec8d75548852e491e33bc5b057a69784e55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
<picture>
    {{ $image := $.Page.Resources.GetMatch (.Get "src") }}
    {{ if gt $image.Width 711 -}}
        {{ $resized := $image.Resize "711x Lanczos" }}
        {{ $resized_2 := $image.Resize "1422x Lanczos" }}
        {{ $resized_3 := $image.Resize "2133x Lanczos" }}
        <source srcset="{{ $resized.Permalink }} 1x, {{ $resized_2.Permalink }} 2x, {{ $resized_3.Permalink }} 3x">
        <img src="{{ $resized.Permalink }}" {{ if isset .Params "alt" -}} alt="{{ .Get "alt"}}" {{- end }}>
    {{ else }}
        <source srcset="{{ $image.Permalink }}">
        <img src="{{ $image.Permalink }}" {{ if isset .Params "alt" -}} alt="{{ .Get "alt"}}" {{- end }}>
    {{- end}}
</picture>