fix: relative image references in leaf bundles

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
David Karlsson 2024-10-07 12:52:16 +02:00
parent c8d77aeb2e
commit ef0d03ff26
1 changed files with 1 additions and 1 deletions

View File

@ -2,7 +2,7 @@
{{- $src := $u.String -}}
{{ if not (or $u.IsAbs (strings.HasPrefix $u.String "/")) }}
{{ $base := urls.Parse .Page.Permalink }}
{{ if eq .Page.Kind "section" }}
{{ if strings.HasSuffix .Page.File.BaseFileName "index" }}
{{ $src = $base.JoinPath $u.Path -}}
{{ else }}
{{ $src = $base.JoinPath "../" $u.Path -}}