Skip to content

Commit eb5a84f

Browse files
authored
fix
1 parent f517214 commit eb5a84f

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

layouts/shortcodes/figure.html

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,17 @@
3636
{{- if $cmSrc -}}
3737
{{ $cmSrc.RelPermalink | absURL}} 1080w
3838
{{- else -}}
39-
// hugo not support avif format
40-
{{ if (ne $imageType "avif") }}
41-
{{- with $respSizes -}}
42-
{{- range $i, $e := . -}}
43-
{{- if $i }}, {{ end -}}{{- ($src.Resize (print . "x " $imageType $hint " " $filter) ).RelPermalink | absURL }} {{ . }}w
44-
{{- end -}}
45-
{{- end -}}" sizes="{{ $dataSzes }}" />
46-
{{- end -}}
47-
{{- end -}}
39+
// hugo not support avif format
40+
{{ if ne $imageType "avif" }}
41+
{{- with $respSizes -}}
42+
{{- range $i, $e := . -}}
43+
{{- if ge $src.Width . -}}
44+
{{- if $i }}, {{ end -}}{{- ($src.Resize (print . "x " $imageType " " $filter) ).RelPermalink | absURL}} {{ . }}w
45+
{{- end -}}
46+
{{- end -}}
47+
{{- end -}}
48+
{{ end }}
49+
{{- end -}}" sizes="{{ $dataSizes }}" />
4850
{{- end -}}
4951
{{- end }}
5052
<img loading="lazy" src="{{ $src }}{{- if eq ($align) "center" }}#center{{- end }}"

0 commit comments

Comments
 (0)