mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
10 lines
No EOL
359 B
Text
10 lines
No EOL
359 B
Text
{{- $subdir := strings.TrimSuffix (relLangURL "/") (relLangURL "") }}
|
|
{{- $url := .RelPermalink }}
|
|
{{- $url = replaceRE "/[^/]*$" "" $url }}
|
|
{{- $rel_url := strings.TrimPrefix $subdir $url }}
|
|
{{- $rel_url = replaceRE "/[^/]*" "/.." $rel_url }}
|
|
{{- $rel_url = trim $rel_url "/" }}
|
|
{{- if not $rel_url }}
|
|
{{- $rel_url = "." }}
|
|
{{- end }}
|
|
{{- return $rel_url }} |