fix for relative permalinks causing image not to load

This commit is contained in:
2026-06-13 11:45:57 +00:00
Unverified
parent 711ddfb3d1
commit b060eed405

View File

@@ -42,7 +42,12 @@
{{ if or (strings.HasPrefix $bgImage "http:") (strings.HasPrefix $bgImage "https:") }} {{ if or (strings.HasPrefix $bgImage "http:") (strings.HasPrefix $bgImage "https:") }}
{{ $bgURL = $bgImage }} {{ $bgURL = $bgImage }}
{{ else }} {{ else }}
{{ $bgURL = $bgImage | absURL }} {{ $bgResource := resources.Get $bgImage }}
{{ if $bgResource }}
{{ $bgURL = $bgResource.RelPermalink }}
{{ else }}
{{ $bgURL = $bgImage | relURL }}
{{ end }}
{{ end }} {{ end }}
<div id="global-background" class="fixed inset-0 overflow-hidden pointer-events-none single_hero_background nozoom" style="z-index: -1;"> <div id="global-background" class="fixed inset-0 overflow-hidden pointer-events-none single_hero_background nozoom" style="z-index: -1;">
{{ $style := "" }} {{ $style := "" }}