File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 30
30
{{- range $imageType := $imageTypes -}}
31
31
< source type ="image/{{ $imageType }} " srcset ="
32
32
{{- $compressedImage := printf "%s_1080x.%s " $src $imageType -}}
33
- {{- $cmSrc := $Page.Resources.GetMatch $compressedImage -}}
33
+ {{- $cmSrc := $. Page.Resources.GetMatch $compressedImage -}}
34
34
{{- if $cmSrc -}}
35
35
{{ $cmSrc.RelPermalink | absURL}} 1080w
36
36
{{- else -}}
37
- {{- with $respSizes -}}
38
- {{- range $i, $e : = . -}}
39
- {{- if $i }}, {{ end -}}{{- ($src.Resize (print . "x " $imageType $hint " " $filter) ).RelPermalink | absURL }} {{ . }}w
40
- {{- end -}}
41
- {{- end -}}" sizes="{{ $dataSzes }} " />
37
+ // hugo not support avif format
38
+ {{ if ne $imageType "avif" }}
39
+ {{- with $respSizes -}}
40
+ {{- range $i, $e := . -}}
41
+ {{- if $i }}, {{ end -}}{{- ($src.Resize (print . "x " $imageType $hint " " $filter) ).RelPermalink | absURL }} {{ . }}w
42
+ {{- end -}}
43
+ {{- end -}}" sizes="{{ $dataSzes }} " />
44
+ {{- end -}}
42
45
{{- end -}}
43
46
{{- end -}}
44
47
{{- end }}
You can’t perform that action at this time.
0 commit comments