Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/spech66/bootstrap-bp-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pech <windows@spech.de>2021-02-13 16:12:28 +0300
committerSebastian Pech <windows@spech.de>2021-02-13 16:12:28 +0300
commitb89913c2aa4c71d1f784b58c86ce545d0fa8e34f (patch)
treea0956e13835c1d302c1b3043ee3a574ab52c8621
parente8d7a5af1677d355d622eafa46c372ad01532090 (diff)
Better translations menu
-rw-r--r--layouts/partials/i18nlist.html9
1 files changed, 8 insertions, 1 deletions
diff --git a/layouts/partials/i18nlist.html b/layouts/partials/i18nlist.html
index 282ebd1..39ae941 100644
--- a/layouts/partials/i18nlist.html
+++ b/layouts/partials/i18nlist.html
@@ -2,10 +2,17 @@
<h5>{{ i18n "translations" }}</h5>
<ul class="list-unstyled">
{{ range .Translations }}
- <li><a href="{{ .RelPermalink }}">{{ .Title }} ({{ .Lang }})</a></li>
+ <li><a href="{{ .RelPermalink }}">{{ if .Title }}{{ .Title }}{{ else }}{{ .Site.Title }}{{ end }} ({{ .Lang }})</a></li>
{{ end}}
{{ range $.Site.Home.AllTranslations }}
<li><a href="{{ .RelPermalink }}">{{ .Language.LanguageName }}</a></li>
{{ end }}
</ul>
+{{ else if gt (len $.Site.Home.AllTranslations) 0 }}
+ <h5>{{ i18n "translations" }}</h5>
+ <ul class="list-unstyled">
+ {{ range $.Site.Home.AllTranslations }}
+ <li><a href="{{ .RelPermalink }}">{{ .Language.LanguageName }}</a></li>
+ {{ end }}
+ </ul>
{{ end }}