mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
alias: fix redirect URLs in case of empty BaseURL #562
This commit is contained in:
parent
e3ac6efd7c
commit
35a4fd83ef
1 changed files with 5 additions and 1 deletions
|
@ -1,7 +1,11 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<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 }}
|
{{- with site.Home.GetPage $url }}
|
||||||
{{- $c := "" }}{{/* if defaultContentLanguageInSubdir=false we are ending here for home page of the default language */}}
|
{{- $c := "" }}{{/* if defaultContentLanguageInSubdir=false we are ending here for home page of the default language */}}
|
||||||
{{- $url = partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}
|
{{- $url = partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}
|
||||||
|
|
Loading…
Reference in a new issue