File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change 1
- {{- $respSizes := slice 720 1080 -}}
2
- {{- $dataSzes := "(min-width: 768px) 1080px, 100vw" -}}
1
+ {{- $respSizes := slice 1080 -}}
2
+ {{- $dataSizes := "(min-width: 768px) 1080px, 100vw" -}}
3
3
4
4
{{- $holder := "GIP" -}}
5
5
{{- $hint := "photo" -}}
13
13
14
14
{{ with $src := .Page.Resources.GetMatch .Destination }}
15
15
{{- if $responsiveImages -}}
16
- < picture >
17
- {{- $imageTypes := slice $src.MediaType.SubType -}}
18
- {{- if and hugo.IsExtended (ne $src.MediaType.Type "image/ webp") -}}
19
- {{- $imageTypes = $imageTypes | append "webp" -}}
20
- {{- end -}}
21
- {{- if gt (index $respSizes 0) $src.Width -}}
22
- {{- $respSizes = slice $src.Width -}}
23
- {{- end -}}
16
+ {{- $imageTypes := slice $src.MediaType.SubType -}}
17
+ {{- if and hugo.IsExtended (ne $src.MediaType.Type "image/webp") -}}
18
+ {{- $imageTypes = $imageTypes | append " webp" -}}
19
+ {{- end -}}
20
+ {{- if gt (index $respSizes 0) $src.Width -}}
21
+ {{- $respSizes = slice $src.Width -}}
22
+ {{- end -}}
23
+ < picture t ="" >
24
24
{{- range $imageType := $imageTypes -}}
25
25
< source type ="image/{{ $imageType }} " srcset ="
26
26
{{- with $respSizes -}}
29
29
{{- if $i }}, {{ end -}}{{- ($src.Resize (print . "x " $imageType " " $filter) ).RelPermalink | absURL}} {{ . }}w
30
30
{{- end -}}
31
31
{{- end -}}
32
- {{- end -}}, {{$src.Permalink }} {{printf "%dw" ($src.Width)}}" sizes="{{ $dataSzes }} " />
32
+ {{- end -}}" sizes="{{ $dataSizes }} " />
33
33
{{- end -}}
34
34
< img src ="{{ $Destination | safeURL }} " width ="{{ .Width }} " height ="{{ .Height }} " alt ="{{ $Text }} " title ="{{ $Title }} " loading ="lazy " />
35
35
</ picture >
You can’t perform that action at this time.
0 commit comments