github.com/choria-io/go-choria@v0.28.1-0.20240416190746-b3bf9c7d5a45/docs/themes/hugo-theme-relearn/layouts/partials/relBaseUri.hugo (about) 1 {{- /* generates an uphill path from the current page to the root of the server */}} 2 {{- $subdir := strings.TrimSuffix (relLangURL "/") (relLangURL "") }} 3 {{- $relBaseUri := .RelPermalink }} 4 {{- $relBaseUri = replaceRE "/[^/]*$" "" $relBaseUri }} 5 {{- $relBaseUri = replaceRE "/[^/]*" "/.." $relBaseUri }} 6 {{- $relBaseUri = trim $relBaseUri "/" }} 7 {{- if not $relBaseUri }} 8 {{- $relBaseUri = "." }} 9 {{- end }} 10 {{- return $relBaseUri }}