mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy.org.git
synced 2025-01-15 13:26:37 +00:00
Merge pull request 'New lang selector' (#157) from nevfy/selfprivacy.org:fix-lang-sel into master
Reviewed-on: https://git.selfprivacy.org/SelfPrivacy/selfprivacy.org/pulls/157
This commit is contained in:
commit
73327e6fa9
|
@ -49,7 +49,7 @@
|
||||||
</li>
|
</li>
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
{{ if (gt (len .Site.Home.Translations) 0) -}}
|
{{ 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" . -}}
|
{{ partial "navbar-lang-selector.html" . -}}
|
||||||
</li>
|
</li>
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
|
|
@ -23,9 +23,9 @@
|
||||||
{{- if .Site.Params.ui.sidebar_menu_foldable }} foldable-nav{{ end -}}
|
{{- if .Site.Params.ui.sidebar_menu_foldable }} foldable-nav{{ end -}}
|
||||||
" id="td-section-nav">
|
" id="td-section-nav">
|
||||||
{{ if (gt (len .Site.Home.Translations) 0) -}}
|
{{ 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" . }}
|
{{ partial "navbar-lang-selector.html" . }}
|
||||||
</div>
|
</div> -->
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
{{ $navRoot := cond (and (ne .Params.toc_root true) (eq .Site.Home.Type "docs")) .Site.Home .FirstSection -}}
|
{{ $navRoot := cond (and (ne .Params.toc_root true) (eq .Site.Home.Type "docs")) .Site.Home .FirstSection -}}
|
||||||
{{ $ulNr := 0 -}}
|
{{ $ulNr := 0 -}}
|
||||||
|
|
|
@ -204,3 +204,8 @@ a, a.btn-link {
|
||||||
#sp-logo-keyhole {
|
#sp-logo-keyhole {
|
||||||
fill: $yellow
|
fill: $yellow
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.lang-selector > ul > .nav-item > .nav-link {
|
||||||
|
padding: .5rem !important;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
|
@ -8,7 +8,7 @@ ul.ul-2>.td-sidebar-nav__section-title a {
|
||||||
}
|
}
|
||||||
|
|
||||||
ul.ul-2 {
|
ul.ul-2 {
|
||||||
padding: 0 2rem;
|
padding: 0 0 0 2rem;
|
||||||
&>.td-sidebar-nav__section-title a:hover {
|
&>.td-sidebar-nav__section-title a:hover {
|
||||||
color: $primary !important;
|
color: $primary !important;
|
||||||
background-color: #7EB07F11;
|
background-color: #7EB07F11;
|
||||||
|
@ -17,6 +17,10 @@ ul.ul-2 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.td-sidebar-nav__section.ul-0 {
|
||||||
|
padding: 0 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
ul.ul-0 li a.tree-root,
|
ul.ul-0 li a.tree-root,
|
||||||
h5.taxonomy-title {
|
h5.taxonomy-title {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
{{/* Link directly to documentation etc., if possible. */}}
|
{{/* Link directly to documentation etc., if possible. */}}
|
||||||
{{ $langPage := cond (gt (len .Translations) 0) . .Site.Home }}
|
{{ $langPage := cond (gt (len .Translations) 0) . .Site.Home }}
|
||||||
<div class="dropdown">
|
{{ $currentLang := .Language.Lang }}
|
||||||
<a role="button" class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
<div class="lang-selector">
|
||||||
<i class="fas fa-globe ms-2"></i>
|
<ul class="d-flex">
|
||||||
</a>
|
|
||||||
<ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
|
||||||
{{ range $langPage.AllTranslations }}
|
{{ 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 }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
Loading…
Reference in a new issue