We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 38891b9 commit 10141e2Copy full SHA for 10141e2
layouts/partials/cover.html
@@ -9,7 +9,10 @@
9
{{- if $addLink }}<a href="{{ (path.Join .RelPermalink .Params.cover.image) | absURL }}" target="_blank"
10
rel="noopener noreferrer">{{ end -}}
11
{{- $sizes := (slice "360" "480" "720" "1080" "1500") }}
12
- {{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") }}
+ {{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}}
13
+ {{- if hugo.IsExtended -}}
14
+ {{- $processableFormats = $processableFormats | append "webp" -}}
15
+ {{- end -}}
16
{{- $prod := (hugo.IsProduction | or (eq .Site.Params.env "production")) }}
17
{{- if (and (in $processableFormats $cover.MediaType.SubType) ($responsiveImages) (eq $prod true)) }}
18
<img loading="lazy" srcset="{{- range $size := $sizes -}}
0 commit comments