diff --git a/layouts/partials/relBaseUri.hugo b/layouts/partials/relBaseUri.hugo new file mode 100644 index 0000000000..b2c6e50147 --- /dev/null +++ b/layouts/partials/relBaseUri.hugo @@ -0,0 +1,10 @@ +{{- /* generates an uphill path from the current page to the root of the server */}} +{{- $subdir := strings.TrimSuffix (relLangURL "/") (relLangURL "") }} +{{- $relBaseUri := .RelPermalink }} +{{- $relBaseUri = replaceRE "/[^/]*$" "" $relBaseUri }} +{{- $relBaseUri = replaceRE "/[^/]*" "/.." $relBaseUri }} +{{- $relBaseUri = trim $relBaseUri "/" }} +{{- if not $relBaseUri }} + {{- $relBaseUri = "." }} +{{- end }} +{{- return $relBaseUri }} \ No newline at end of file diff --git a/layouts/partials/stylesheet.html b/layouts/partials/stylesheet.html index 3c46178820..3952a103c4 100644 --- a/layouts/partials/stylesheet.html +++ b/layouts/partials/stylesheet.html @@ -31,6 +31,7 @@