search: fix result links for pages in root #810

This commit is contained in:
Sören Weber 2024-03-18 10:36:29 +01:00
parent 5b8367085f
commit 69c71369fa
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D

View file

@ -4,4 +4,7 @@
{{- $rel_url := strings.TrimPrefix $subdir $url }} {{- $rel_url := strings.TrimPrefix $subdir $url }}
{{- $rel_url = replaceRE "/[^/]*" "/.." $rel_url }} {{- $rel_url = replaceRE "/[^/]*" "/.." $rel_url }}
{{- $rel_url = trim $rel_url "/" }} {{- $rel_url = trim $rel_url "/" }}
{{- if not $rel_url }}
{{- $rel_url = "." }}
{{- end }}
{{- return $rel_url }} {{- return $rel_url }}