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,14 +35,15 @@
{{ partial "css" . }} {{ partial "css" . }}
{{ if .IsHome }} {{ if .IsHome }}
{{ with .Site.GetPage "/headless/main/hero" }} {{ $srcset := slice
{{ with .Params.astronauts }} (printf "%s 960w" (absURL "/img/home/hero/astronauts-960.webp"))
<link rel="preload" as="image" type="image/webp" fetchpriority="high" (printf "%s 1920w" (absURL "/img/home/hero/astronauts-1920.webp"))
imagesrcset="{{ .webpSrcset }}" (printf "%s 3840w" (absURL "/img/home/hero/astronauts.webp"))
imagesizes="100vw" }}
/> <link rel="preload" as="image" type="image/webp" fetchpriority="high"
{{ end }} imagesrcset="{{ delimit $srcset ", " }}"
{{ end }} imagesizes="100vw"
/>
{{ end }} {{ end }}
{{ hugo.Generator }} {{ hugo.Generator }}