Skip to content

Commit

Permalink
alias: fix redirect URLs in case of empty BaseURL #562
Browse files Browse the repository at this point in the history
  • Loading branch information
McShelby committed Jun 9, 2023
1 parent e3ac6ef commit 35a4fd8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion layouts/alias.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<!DOCTYPE html>
<html>
<head>
{{- $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" .) }}
Expand Down

0 comments on commit 35a4fd8

Please sign in to comment.