just replace absLangURL with absURL, stop using DisableLanguageSwitch
start from this commit, PaperModX will no longer support multi language site, post still have language, but there won't be /zh, /zh/archives pages
This commit is contained in:
parent
8c344920f1
commit
a4d7eb3419
|
@ -3,7 +3,7 @@
|
||||||
{{- $url := replace .Parent.Permalink (printf "%s" site.BaseURL) "" }}
|
{{- $url := replace .Parent.Permalink (printf "%s" site.BaseURL) "" }}
|
||||||
{{- $lang_url := strings.TrimPrefix (printf "%s/" .Lang) $url -}}
|
{{- $lang_url := strings.TrimPrefix (printf "%s/" .Lang) $url -}}
|
||||||
|
|
||||||
<a href="{{ "" | absLangURL }}">{{ i18n "home" | default "Home" }}</a>
|
<a href="{{ "" | absURL }}">{{ i18n "home" | default "Home" }}</a>
|
||||||
{{- $scratch := newScratch }}
|
{{- $scratch := newScratch }}
|
||||||
{{- range $index, $element := split $lang_url "/" }}
|
{{- range $index, $element := split $lang_url "/" }}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
{{- if site.Copyright }}
|
{{- if site.Copyright }}
|
||||||
<span>{{ site.Copyright | markdownify }}</span>
|
<span>{{ site.Copyright | markdownify }}</span>
|
||||||
{{- else }}
|
{{- else }}
|
||||||
<span>© {{ now.Year }} <a href="{{ "" | absLangURL }}">{{ site.Title }}</a></span>
|
<span>© {{ now.Year }} <a href="{{ "" | absURL }}">{{ site.Title }}</a></span>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
<span style="display: inline-block; margin-left: 1em;">
|
<span style="display: inline-block; margin-left: 1em;">
|
||||||
<a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA</a>
|
<a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA</a>
|
||||||
|
|
|
@ -44,11 +44,7 @@
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
{{- $label_text := (site.Params.label.text | default site.Title) }}
|
{{- $label_text := (site.Params.label.text | default site.Title) }}
|
||||||
{{- if site.Title }}
|
{{- if site.Title }}
|
||||||
{{- if site.Params.DisableLanguageSwitch }}
|
|
||||||
<a href="/" accesskey="h" title="{{ $label_text }} (Alt + H)">
|
<a href="/" accesskey="h" title="{{ $label_text }} (Alt + H)">
|
||||||
{{- else }}
|
|
||||||
<a href="{{ "" | absLangURL }}" accesskey="h" title="{{ $label_text }} (Alt + H)">
|
|
||||||
{{- end }}
|
|
||||||
{{- if site.Params.label.icon }}
|
{{- if site.Params.label.icon }}
|
||||||
{{- $img := resources.Get site.Params.label.icon }}
|
{{- $img := resources.Get site.Params.label.icon }}
|
||||||
{{- if $img }}
|
{{- if $img }}
|
||||||
|
@ -97,40 +93,16 @@
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- if not site.Params.DisableLanguageSwitch }}
|
|
||||||
{{- $lang := .Lang}}
|
|
||||||
{{- $separator := or $label_text (not site.Params.disableThemeToggle)}}
|
|
||||||
{{- with site.Home.AllTranslations }}
|
|
||||||
<ul class="lang-switch">
|
|
||||||
{{- if $separator }}<li>|</li>{{ end }}
|
|
||||||
{{- range . -}}
|
|
||||||
{{- if ne $lang .Lang }}
|
|
||||||
<li>
|
|
||||||
<a href="{{- .Permalink -}}" title="{{ .Language.Params.languageAltTitle | default (.Language.LanguageName | emojify) | default (.Lang | title) }}"
|
|
||||||
aria-label="{{ .Language.LanguageName | default (.Lang | title) }}">
|
|
||||||
{{- if (and site.Params.displayFullLangName (.Language.LanguageName)) }}
|
|
||||||
{{- .Language.LanguageName | emojify -}}
|
|
||||||
{{- else }}
|
|
||||||
{{- .Lang | title -}}
|
|
||||||
{{- end -}}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
{{- end -}}
|
|
||||||
{{- end}}
|
|
||||||
</ul>
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{{- $currentPage := . }}
|
{{- $currentPage := . }}
|
||||||
<ul id="menu">
|
<ul id="menu">
|
||||||
{{- range site.Menus.main }}
|
{{- range site.Menus.main }}
|
||||||
{{- $menu_item_url := (cond (strings.HasSuffix .URL "/") .URL (printf "%s/" .URL) ) | absLangURL }}
|
{{- $menu_item_url := (cond (strings.HasSuffix .URL "/") .URL (printf "%s/" .URL) ) | absURL }}
|
||||||
{{- $page_url:= $currentPage.Permalink | absLangURL }}
|
{{- $page_url:= $currentPage.Permalink | absURL }}
|
||||||
{{- $is_search := eq (site.GetPage .KeyName).Layout `search` }}
|
{{- $is_search := eq (site.GetPage .KeyName).Layout `search` }}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ .URL | absLangURL }}" title="{{ .Title | default .Name }} {{- cond $is_search (" (Alt + /)" | safeHTMLAttr) ("" | safeHTMLAttr ) }}"
|
<a href="{{ .URL | absURL }}" title="{{ .Title | default .Name }} {{- cond $is_search (" (Alt + /)" | safeHTMLAttr) ("" | safeHTMLAttr ) }}"
|
||||||
{{- if $is_search -}}data-no-instant{{- end -}}
|
{{- if $is_search -}}data-no-instant{{- end -}}
|
||||||
{{- cond $is_search (" accesskey=/" | safeHTMLAttr) ("" | safeHTMLAttr ) }}
|
{{- cond $is_search (" accesskey=/" | safeHTMLAttr) ("" | safeHTMLAttr ) }}
|
||||||
{{- if eq $menu_item_url $page_url }} class="active" {{- end }}
|
{{- if eq $menu_item_url $page_url }} class="active" {{- end }}
|
||||||
|
|
Loading…
Reference in New Issue