mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
theme: fix alias for home page if defaultContentLanguageInSubdir=true #414
This commit is contained in:
parent
16f3f0e73d
commit
dd8292acca
1 changed files with 13 additions and 1 deletions
|
@ -2,7 +2,19 @@
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
{{- $url := replace (replace .Permalink site.BaseURL "/") "//" "/" }}
|
{{- $url := replace (replace .Permalink site.BaseURL "/") "//" "/" }}
|
||||||
|
{{- 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" .) }}
|
||||||
|
{{- else }}
|
||||||
|
{{- $url_alt := replaceRE "^/[^/]*(/.*)" "${1}" $url }}
|
||||||
|
{{- with site.Home.GetPage $url_alt }}
|
||||||
|
{{- $c := "" }}{{/* if defaultContentLanguageInSubdir=true we are ending here for home page */}}
|
||||||
|
{{- $url = partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}
|
||||||
|
{{- else }}
|
||||||
|
{{- $c := "" }}{{/* for regular aliases we are ending here with no original page found */}}
|
||||||
{{- $url = partial "relLangPrettyUglyURL.hugo" (dict "link" $url) }}
|
{{- $url = partial "relLangPrettyUglyURL.hugo" (dict "link" $url) }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="robots" content="noindex">
|
<meta name="robots" content="noindex">
|
||||||
<meta http-equiv="refresh" content="0; url={{ $url }}">
|
<meta http-equiv="refresh" content="0; url={{ $url }}">
|
||||||
|
|
Loading…
Reference in a new issue