mirror of
https://github.com/McShelby/hugo-theme-relearn
synced 2025-04-30 16:49:05 +08:00
theme: fix alias for home page if defaultContentLanguageInSubdir=true #414
This commit is contained in:
parent
16f3f0e73d
commit
dd8292acca
@ -2,7 +2,19 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
{{- $url := replace (replace .Permalink site.BaseURL "/") "//" "/" }}
|
{{- $url := replace (replace .Permalink site.BaseURL "/") "//" "/" }}
|
||||||
{{- $url = partial "relLangPrettyUglyURL.hugo" (dict "link" $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" .) }}
|
||||||
|
{{- 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) }}
|
||||||
|
{{- 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…
x
Reference in New Issue
Block a user