{{- $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 "/" }} {{- return $rel_url }}