mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
theme: fix multilang links when site served from subdirectory #370
This commit is contained in:
parent
460ab79e66
commit
b9e97bcc0b
2 changed files with 2 additions and 5 deletions
|
@ -76,9 +76,9 @@
|
|||
{{- range $siteLanguages }}
|
||||
{{- if eq $translation.Lang .Lang }}
|
||||
{{- if eq $pageLang .Lang }}
|
||||
<option lang="{{ $translation.Lang }}" id="{{ $translation.Lang }}" value="{{ partial "relLangPrettyUglyURL.hugo" (dict "page" $page "to" $translation "isTranslation" true) }}" selected>{{ .LanguageName }}</option>
|
||||
<option lang="{{ $translation.Lang }}" id="{{ $translation.Lang }}" value="{{ partial "relLangPrettyUglyURL.hugo" (dict "page" $page "to" $translation) }}" selected>{{ .LanguageName }}</option>
|
||||
{{- else }}
|
||||
<option lang="{{ $translation.Lang }}" id="{{ $translation.Lang }}" value="{{ partial "relLangPrettyUglyURL.hugo" (dict "page" $page "to" $translation "isTranslation" true) }}">{{ .LanguageName }}</option>
|
||||
<option lang="{{ $translation.Lang }}" id="{{ $translation.Lang }}" value="{{ partial "relLangPrettyUglyURL.hugo" (dict "page" $page "to" $translation) }}">{{ .LanguageName }}</option>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
{{- $page := .page }}
|
||||
{{- $to := .to }}
|
||||
{{- $link := $to.RelPermalink }}
|
||||
{{- if not .isTranslation }}
|
||||
{{- $link = $link | relLangURL }}
|
||||
{{- end }}
|
||||
{{- if and .page.Site.Params.uglyURLs (eq (substr $link -1) "/") }}
|
||||
{{- $link = printf "%sindex.html" $link }}
|
||||
{{- end }}
|
||||
|
|
Loading…
Reference in a new issue