mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy.org.git
synced 2024-09-07 20:46:57 +00:00
fix: dropdown-free lang selector
This commit is contained in:
parent
1d296b0921
commit
03db6f624c
|
@ -49,7 +49,7 @@
|
|||
</li>
|
||||
{{ end -}}
|
||||
{{ if (gt (len .Site.Home.Translations) 0) -}}
|
||||
<li class="nav-item dropdown d-none d-lg-block">
|
||||
<li class="nav-item">
|
||||
{{ partial "navbar-lang-selector.html" . -}}
|
||||
</li>
|
||||
{{ end -}}
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
{{- if .Site.Params.ui.sidebar_menu_foldable }} foldable-nav{{ end -}}
|
||||
" id="td-section-nav">
|
||||
{{ if (gt (len .Site.Home.Translations) 0) -}}
|
||||
<div class="td-sidebar-nav__section nav-item dropdown d-block d-lg-none">
|
||||
<!-- <div class="td-sidebar-nav__section nav-item dropdown d-block d-lg-none">
|
||||
{{ partial "navbar-lang-selector.html" . }}
|
||||
</div>
|
||||
</div> -->
|
||||
{{ end -}}
|
||||
{{ $navRoot := cond (and (ne .Params.toc_root true) (eq .Site.Home.Type "docs")) .Site.Home .FirstSection -}}
|
||||
{{ $ulNr := 0 -}}
|
||||
|
|
|
@ -203,4 +203,9 @@ a, a.btn-link {
|
|||
|
||||
#sp-logo-keyhole {
|
||||
fill: $yellow
|
||||
}
|
||||
|
||||
.lang-selector > ul > .nav-item > .nav-link {
|
||||
padding: .5rem !important;
|
||||
text-transform: uppercase;
|
||||
}
|
|
@ -1,12 +1,14 @@
|
|||
{{/* Link directly to documentation etc., if possible. */}}
|
||||
{{ $langPage := cond (gt (len .Translations) 0) . .Site.Home }}
|
||||
<div class="dropdown">
|
||||
<a role="button" class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fas fa-globe ms-2"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||
{{ $currentLang := .Language.Lang }}
|
||||
<div class="lang-selector">
|
||||
<ul class="d-flex">
|
||||
{{ range $langPage.AllTranslations }}
|
||||
<li><a class="dropdown-item" href="{{ .RelPermalink }}">{{ .Language.LanguageName }}</a></li>
|
||||
{{ if eq $currentLang .Language.Lang }}
|
||||
<li class="nav-item"><a class="nav-link active" href="{{ .RelPermalink }}">{{ .Language.Lang }}</a></li>
|
||||
{{ else }}
|
||||
<li class="nav-item"><a class="nav-link" href="{{ .RelPermalink }}">{{ .Language.Lang }}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
Loading…
Reference in a new issue