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