Skip to content

Commit b5adf31

Browse files
authored
fix
1 parent 72b8b0b commit b5adf31

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

layouts/_default/_markup/render-image.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
{{- if $responsiveImages -}}
1717
{{- $imageTypes := slice -}}
1818
{{- if and hugo.IsExtended (ne $src.MediaType.Type "image/webp") -}}
19+
{{- $imageTypes = $imageTypes | append "avif" -}} <!-- avif need the first -->
1920
{{- $imageTypes = $imageTypes | append "webp" -}}
2021
{{- end -}}
2122
{{- if gt (index $respSizes 0) $src.Width -}}
@@ -29,7 +30,7 @@
2930
{{- if $cmSrc -}}
3031
{{ $cmSrc.RelPermalink | absURL}} 1080w
3132
{{- else -}}
32-
// hugo not support avif format
33+
<!-- hugo not support avif format -->
3334
{{ if ne $imageType "avif" }}
3435
{{- with $respSizes -}}
3536
{{- range $i, $e := . -}}

layouts/shortcodes/figure.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
{{- if $responsiveImages -}}
2727
{{- $imageTypes := slice -}}
2828
{{- if and hugo.IsExtended (ne $src.MediaType.Type "image/webp") -}}
29-
{{- $imageTypes = $imageTypes | append "avif" -}} // avif need the first
29+
{{- $imageTypes = $imageTypes | append "avif" -}} <!-- avif need the first -->
3030
{{- $imageTypes = $imageTypes | append "webp" -}}
3131
{{- end -}}
3232
{{- range $imageType := $imageTypes -}}
@@ -36,7 +36,7 @@
3636
{{- if $cmSrc -}}
3737
{{ $cmSrc.RelPermalink | absURL}} 1080w
3838
{{- else -}}
39-
// hugo not support avif format
39+
<!-- hugo not support avif format -->
4040
{{ if ne $imageType "avif" }}
4141
{{- with $respSizes -}}
4242
{{- range $i, $e := . -}}

0 commit comments

Comments
 (0)