Skip to content

Commit c3c5211

Browse files
authored
fix
1 parent 4fbe428 commit c3c5211

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

layouts/shortcodes/figure.html

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,18 @@
3030
{{- range $imageType := $imageTypes -}}
3131
<source type="image/{{ $imageType }}" srcset="
3232
{{- $compressedImage := printf "%s_1080x.%s" $src $imageType -}}
33-
{{- $cmSrc := $Page.Resources.GetMatch $compressedImage -}}
33+
{{- $cmSrc := $.Page.Resources.GetMatch $compressedImage -}}
3434
{{- if $cmSrc -}}
3535
{{ $cmSrc.RelPermalink | absURL}} 1080w
3636
{{- 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 -}}
4245
{{- end -}}
4346
{{- end -}}
4447
{{- end }}

0 commit comments

Comments
 (0)