Add language select
This commit is contained in:
parent
0c40eb4ab7
commit
b90922a68f
@ -16,6 +16,7 @@ googleAnalytics = ""
|
||||
description = "Anubis is a simple minimalist theme for Hugo blog engine."
|
||||
|
||||
[languages.en]
|
||||
languageName = "English"
|
||||
|
||||
[[menu.main]]
|
||||
identifier = "about"
|
||||
@ -35,6 +36,9 @@ googleAnalytics = ""
|
||||
url = "/posts/"
|
||||
weight = 3
|
||||
|
||||
[languages.pl]
|
||||
languageName = "Polski"
|
||||
|
||||
[[languages.pl.menu.main]]
|
||||
identifier = "about"
|
||||
name = "O Hugo"
|
||||
|
@ -18,6 +18,11 @@
|
||||
</main>
|
||||
<footer>
|
||||
{{ block "footer" . }}
|
||||
{{ $languagesCount := $.Site.Home.AllTranslations }}
|
||||
{{ if gt $languagesCount 1 }}
|
||||
{{ partial "languageSelect.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "footer.html" . }}
|
||||
{{ end }}
|
||||
</footer>
|
||||
|
5
layouts/partials/languageSelect.html
Normal file
5
layouts/partials/languageSelect.html
Normal file
@ -0,0 +1,5 @@
|
||||
<ul class="language-select">
|
||||
{{ range $.Site.Home.AllTranslations }}
|
||||
<li><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
@ -349,6 +349,16 @@ footer {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
ul.language-select {
|
||||
padding-left: 0;
|
||||
list-style: none;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
ul.language-select > li {
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
/* Media Queries */
|
||||
|
||||
@media (max-width: 840px) {
|
||||
|
Loading…
Reference in New Issue
Block a user