fix: link render hook produces dangling links when base URL has additional segments (#660)

* fix: link render hook produces dangling links when base URL has additional segments

* fix: incorrect fragment character in image render hook
This commit is contained in:
Justin Chen
2025-04-09 22:47:02 +01:00
committed by GitHub
parent d08b077acd
commit 1eb4b9ea23
2 changed files with 15 additions and 2 deletions
+1 -1
View File
@@ -13,7 +13,7 @@
{{- with or (.PageInner.Resources.Get $url.Path) (resources.Get $url.Path) -}}
{{/* Images under assets directory */}}
{{- $query := cond $url.RawQuery (printf "?%s" $url.RawQuery) "" -}}
{{- $fragment := cond $url.Fragment (printf "?%s" $url.Fragment) "" -}}
{{- $fragment := cond $url.Fragment (printf "#%s" $url.Fragment) "" -}}
{{- $dest = printf "%s%s%s" .RelPermalink $query $fragment -}}
{{- else -}}
{{/* Images under static directory */}}