Skip to content

Commit bef7f72

Browse files
authored
Update render-image.html
1 parent 79dd3ae commit bef7f72

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

layouts/_default/_markup/render-image.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
{{- $respSizes := slice 720 1080 -}}
2-
{{- $dataSzes := "(min-width: 768px) 1080px, 100vw" -}}
1+
{{- $respSizes := slice 1080 -}}
2+
{{- $dataSizes := "(min-width: 768px) 1080px, 100vw" -}}
33

44
{{- $holder := "GIP" -}}
55
{{- $hint := "photo" -}}
@@ -13,14 +13,14 @@
1313

1414
{{ with $src := .Page.Resources.GetMatch .Destination }}
1515
{{- if $responsiveImages -}}
16-
<picture>
17-
{{- $imageTypes := slice $src.MediaType.SubType -}}
18-
{{- if and hugo.IsExtended (ne $src.MediaType.Type "image/webp") -}}
19-
{{- $imageTypes = $imageTypes | append "webp" -}}
20-
{{- end -}}
21-
{{- if gt (index $respSizes 0) $src.Width -}}
22-
{{- $respSizes = slice $src.Width -}}
23-
{{- end -}}
16+
{{- $imageTypes := slice $src.MediaType.SubType -}}
17+
{{- if and hugo.IsExtended (ne $src.MediaType.Type "image/webp") -}}
18+
{{- $imageTypes = $imageTypes | append "webp" -}}
19+
{{- end -}}
20+
{{- if gt (index $respSizes 0) $src.Width -}}
21+
{{- $respSizes = slice $src.Width -}}
22+
{{- end -}}
23+
<picture t="">
2424
{{- range $imageType := $imageTypes -}}
2525
<source type="image/{{ $imageType }}" srcset="
2626
{{- with $respSizes -}}
@@ -29,7 +29,7 @@
2929
{{- if $i }}, {{ end -}}{{- ($src.Resize (print . "x " $imageType " " $filter) ).RelPermalink | absURL}} {{ . }}w
3030
{{- end -}}
3131
{{- end -}}
32-
{{- end -}}, {{$src.Permalink }} {{printf "%dw" ($src.Width)}}" sizes="{{ $dataSzes }}" />
32+
{{- end -}}" sizes="{{ $dataSizes }}" />
3333
{{- end -}}
3434
<img src="{{ $Destination | safeURL }}" width="{{ .Width }}" height="{{ .Height }}" alt="{{ $Text }}" title="{{ $Title }}" loading="lazy" />
3535
</picture>

0 commit comments

Comments
 (0)