absolute url in the link preload imagesrcset (#2203)

This commit is contained in:
trean
2026-03-14 22:41:30 +01:00
committed by GitHub
parent 456e01b514
commit ee157d8fa2
@@ -35,15 +35,16 @@
{{ partial "css" . }}
{{ if .IsHome }}
{{ with .Site.GetPage "/headless/main/hero" }}
{{ with .Params.astronauts }}
{{ $srcset := slice
(printf "%s 960w" (absURL "/img/home/hero/astronauts-960.webp"))
(printf "%s 1920w" (absURL "/img/home/hero/astronauts-1920.webp"))
(printf "%s 3840w" (absURL "/img/home/hero/astronauts.webp"))
}}
<link rel="preload" as="image" type="image/webp" fetchpriority="high"
imagesrcset="{{ .webpSrcset }}"
imagesrcset="{{ delimit $srcset ", " }}"
imagesizes="100vw"
/>
{{ end }}
{{ end }}
{{ end }}
{{ hugo.Generator }}