diff --git a/layouts/alias.html b/layouts/alias.html index e63cc4bdea..2b3db29811 100644 --- a/layouts/alias.html +++ b/layouts/alias.html @@ -1,7 +1,11 @@ - {{- $url := replace (replace .Permalink site.BaseURL "/") "//" "/" }} + {{- $url := .Permalink }} + {{- if site.BaseURL }} + {{- $url = replace .Permalink site.BaseURL "/" }} + {{- end }} + {{- $url = replace $url "//" "/" }} {{- with site.Home.GetPage $url }} {{- $c := "" }}{{/* if defaultContentLanguageInSubdir=false we are ending here for home page of the default language */}} {{- $url = partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}