Links zu Datenschutzerklärung und Impressum eingefügt
This commit is contained in:
parent
b6c809ea1e
commit
67542d11d5
10 changed files with 70 additions and 72 deletions
|
|
@ -1,28 +1,14 @@
|
|||
<!-- Language List -->
|
||||
<!-- Language Switcher -->
|
||||
{{ $current := .Context }}
|
||||
{{ $class := .Class }}
|
||||
{{ $context := .Context }}
|
||||
{{ $pageLang := $context.Lang }}
|
||||
{{ $base:= urls.Parse site.Home.Permalink }}
|
||||
{{ $siteLanguages := site.Home.AllTranslations }}
|
||||
{{ $pageLink := replace (replace $context.RelPermalink (add $pageLang "/") "") $base.Path "/" }}
|
||||
|
||||
{{ if $context.IsTranslated }}
|
||||
{{ if $current.IsTranslated }}
|
||||
<select class="{{ $class }}" onchange="location = this.value">
|
||||
{{ range $siteLanguages }}
|
||||
{{ if eq (string $pageLang) (string .Language) }}
|
||||
<option
|
||||
id="{{ .Language }}"
|
||||
value="{{ replace (add .RelPermalink $pageLink) `//` `/` }}"
|
||||
selected>
|
||||
{{ .Language.LanguageName }}
|
||||
</option>
|
||||
{{ else }}
|
||||
<option
|
||||
id="{{ .Language }}"
|
||||
value="{{ replace (add .RelPermalink $pageLink) `//` `/` }}">
|
||||
{{ .Language.LanguageName }}
|
||||
</option>
|
||||
{{ end }}
|
||||
{{/* Current page language */}}
|
||||
<option value="{{ $current.Permalink }}" selected>{{ $current.Language.LanguageName }}</option>
|
||||
|
||||
{{/* Iterate over all translations of the current page */}}
|
||||
{{ range $current.Translations }}
|
||||
<option value="{{ .Permalink }}">{{ .Language.LanguageName }}</option>
|
||||
{{ end }}
|
||||
</select>
|
||||
{{ end }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue