fixed width and height
This commit is contained in:
parent
8db1ca2ad9
commit
b623fd5b54
@ -10,27 +10,37 @@
|
||||
{{ range $index, $image := $carouselImages }}
|
||||
{{- $jpegs := $image.Resize (printf "%dx jpeg q%d" 1024 75) }}
|
||||
{{- $jpegm := $image.Resize (printf "%dx jpeg q%d" 1440 75) }}
|
||||
{{- $jpegl := $image.Resize (printf "%dx jpeg q%d" 2200 75) }}
|
||||
{{- $jpegl := $image.Resize (printf "%dx jpeg q%d" 1920 75) }}
|
||||
{{- $jpegxl := $image.Resize (printf "%dx jpeg q%d" 2560 75) }}
|
||||
{{- $webps := $image.Resize (printf "%dx webp q%d picture" 1024 75) }}
|
||||
{{- $webpm := $image.Resize (printf "%dx webp q%d picture" 1440 75) }}
|
||||
{{- $webpl := $image.Resize (printf "%dx webp q%d picture" 2200 75) }}
|
||||
{{- $webpl := $image.Resize (printf "%dx webp q%d picture" 1920 75) }}
|
||||
{{- $webpxl := $image.Resize (printf "%dx webp q%d picture" 2560 75) }}
|
||||
<figure class="image">
|
||||
<picture>
|
||||
<source type="image/webp"
|
||||
srcset="{{ $webps.Permalink }} {{ $webps.Width }}w,
|
||||
{{ $webpm.Permalink }} {{ $webpm.Width }}w,
|
||||
{{ $webpl.Permalink }} {{ $webpl.Width }}w"
|
||||
{{ $webpl.Permalink }} {{ $webpl.Width }}w,
|
||||
{{ $webpxl.Permalink }} {{ $webpl.Width }}w"
|
||||
sizes="(max-width: 1023px) 100vw,
|
||||
(max-width: 1439px) 1024px,
|
||||
1440px">
|
||||
(max-width: 1919px) 1440px,
|
||||
(max-width: 2559px) 1920px,
|
||||
2560px">
|
||||
<img src='{{ $jpegl.Permalink }}'
|
||||
width="{{ $jpegxl.Width }}"
|
||||
height="{{ $jpegxl.Height }}"
|
||||
{{ if ne $index 0 }} loading="lazy" {{ end }}
|
||||
srcset="{{ $jpegs.Permalink }} {{ $jpegs.Width }}w,
|
||||
{{ $jpegm.Permalink }} {{ $jpegm.Width }}w,
|
||||
{{ $jpegl.Permalink }} {{ $jpegl.Width }}w"
|
||||
{{ $jpegl.Permalink }} {{ $jpegl.Width }}w,
|
||||
{{ $jpegxl.Permalink }} {{ $jpegxl.Width }}w"
|
||||
sizes="(max-width: 1023px) 100vw,
|
||||
(max-width: 1439px) 1024px,
|
||||
1440px">
|
||||
(max-width: 1919px) 1440px,
|
||||
(max-width: 2559px) 1920px,
|
||||
2560px">
|
||||
alt="{{ $image.Permalink }}">
|
||||
</picture>
|
||||
</figure>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user