mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2024-11-17 13:25:57 -06:00
Add a language switcher bar below the navbar
This commit is contained in:
parent
47adfd5f7d
commit
7276be72e9
@ -68,12 +68,16 @@
|
||||
|
||||
|
||||
/* Navbar formatting */
|
||||
#navbar h2 {
|
||||
.navbar, .langbar {
|
||||
margin: 5px 0px;
|
||||
}
|
||||
|
||||
(.navbar, .langbar) h2 {
|
||||
color: inherit;
|
||||
text-decoration: inherit;
|
||||
}
|
||||
|
||||
.navbar-item {
|
||||
.navbar-item, .langbar-item {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
<a href="{{ "/" | relURL }}">{{ .Site.Title | markdownify }}</a>
|
||||
</h2>
|
||||
|
||||
<nav id="navbar">
|
||||
<nav class="navbar">
|
||||
{{ with .Site.GetPage "/" }}
|
||||
{{/* if I use relLangURL, then it does /es/es/ instead of /es/ (for example) */}}
|
||||
<a class="navbar-item" href="{{ .Permalink | relURL }}">{{ .Title }}</a>
|
||||
@ -12,3 +12,17 @@
|
||||
<a class="navbar-item" href="{{ .URL }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
</nav>
|
||||
|
||||
{{ if .Site.IsMultiLingual }}
|
||||
<nav class="langbar">
|
||||
{{ range .Site.Home.AllTranslations }}
|
||||
|
||||
{{ if eq .Language $.Site.Language }}
|
||||
<b><a class="langbar-item" href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></b>
|
||||
{{ else }}
|
||||
<a class="langbar-item" href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
</nav>
|
||||
{{ end }}
|
||||
|
Loading…
Reference in New Issue
Block a user