mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
10 lines
435 B
Go Template
10 lines
435 B
Go Template
|
{{- /* 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 }}
|