File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 17
17
{{- $imageTypes := slice -}}
18
18
{{- if and hugo.IsExtended (ne $src.MediaType.Type "image/webp") -}}
19
19
{{- $imageTypes = $imageTypes | append "webp" -}}
20
+ {{- $imageTypes = $imageTypes | append "avif" -}}
20
21
{{- end -}}
21
22
{{- if gt (index $respSizes 0) $src.Width -}}
22
23
{{- $respSizes = slice $src.Width -}}
29
30
{{- if $cmSrc -}}
30
31
{{ $cmSrc.RelPermalink | absURL}} 1080w
31
32
{{- else -}}
32
- {{- $imageTypes = $imageTypes | append $src.MediaType.SubType -}}
33
+ // hugo not support avif format
34
+ {{ if eq $imageType "avif" }}
33
35
{{- with $respSizes -}}
34
36
{{- range $i, $e := . -}}
35
37
{{- if ge $src.Width . -}}
36
38
{{- if $i }}, {{ end -}}{{- ($src.Resize (print . "x " $imageType " " $filter) ).RelPermalink | absURL}} {{ . }}w
37
39
{{- end -}}
38
40
{{- end -}}
39
41
{{- end -}}
42
+ {{ end }}
40
43
{{- end -}}" sizes="{{ $dataSizes }} " />
41
44
{{- end -}}
42
45
< img src ="{{ $Destination | safeURL }} " width ="{{ .Width }} " height ="{{ .Height }} " alt ="{{ $Text }} " title ="{{ $Title }} " loading ="lazy " />
You can’t perform that action at this time.
0 commit comments