feat: update for multilingual support

This commit is contained in:
Henk Verlinde 2021-09-15 14:36:51 +02:00
parent 2f69479647
commit a549526f88
7 changed files with 28 additions and 21 deletions

View File

@ -75,9 +75,11 @@ $navbar-dark-active-color: $link-color-dark;
background: $body-overlay-dark; background: $body-overlay-dark;
} }
/*
[data-dark-mode] body .dropdown-menu { [data-dark-mode] body .dropdown-menu {
@extend .dropdown-menu-dark; @extend .dropdown-menu-dark;
} }
*/
[data-dark-mode] body .navbar, [data-dark-mode] body .navbar,
[data-dark-mode] body .doks-subnavbar { [data-dark-mode] body .doks-subnavbar {
@ -468,6 +470,10 @@ $navbar-dark-active-color: $link-color-dark;
} }
*/ */
[data-dark-mode] .dropdown-item {
color: $body-bg-dark;
}
[data-dark-mode] body hr.text-black-50 { [data-dark-mode] body hr.text-black-50 {
color: $gray-600 !important; color: $gray-600 !important;
} }

View File

@ -431,3 +431,15 @@ button#doks-versions {
.navbar-light .navbar-nav .active .nav-link { .navbar-light .navbar-nav .active .nav-link {
color: $primary; color: $primary;
} }
.dropdown-divider {
border-top: 1px dashed $gray-200;
}
.dropdown-item:hover {
background: $gray-100;
}
.dropdown-item:active {
color: inherit;
}

View File

@ -11,7 +11,7 @@ rssLimit = 10
# Multilingual # Multilingual
defaultContentLanguage = "en" defaultContentLanguage = "en"
# disableLanguages = ["nl"] disableLanguages = ["de", "nl"]
# defaultContentLanguageInSubdir = true # defaultContentLanguageInSubdir = true
# add redirects/headers # add redirects/headers

View File

@ -5,6 +5,13 @@
[en.params] [en.params]
languageISO = "EN" languageISO = "EN"
[de]
languageName = "German"
contentDir = "content/de"
weight = 15
[de.params]
languageISO = "DE"
[nl] [nl]
languageName = "Nederlands" languageName = "Nederlands"
contentDir = "content/nl" contentDir = "content/nl"

View File

@ -76,5 +76,5 @@ editPage = false
highLight = true highLight = true
kaTex = false kaTex = false
collapsibleSidebar = true collapsibleSidebar = true
multilingualMode = true multilingualMode = false
docsVersioning = false # Not yet functional docsVersioning = false # Not yet functional

View File

@ -8,4 +8,3 @@ draft: false
images: [] images: []
--- ---
:cow:

View File

@ -57,28 +57,12 @@
{{ end -}} {{ end -}}
{{ if eq .Site.Params.options.multilingualMode true -}} {{ if eq .Site.Params.options.multilingualMode true -}}
<!--
<div class="dropdown order-md-2">
<button class="btn btn-doks-light dropdown-toggle" id="doks-languages" data-bs-toggle="dropdown" aria-expanded="false" data-bs-display="static" aria-label="Toggle language menu">
<span class="d-none d-lg-inline"></span>English
</button>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="doks-languages">
<li><a class="dropdown-item current" aria-current="true" href="/docs/5.0/">English</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="https://getbootstrap.com/docs/3.4/">Dutch</a></li>
<li><a class="dropdown-item" href="https://getbootstrap.com/2.3.2/">Russian</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="/docs/contributing/how-to-contribute/">Help Translate</a></li>
</ul>
</div>
-->
<div class="dropdown order-md-2"> <div class="dropdown order-md-2">
<button class="btn btn-doks-light dropdown-toggle" id="doks-languages" data-bs-toggle="dropdown" aria-expanded="false" data-bs-display="static"> <button class="btn btn-doks-light dropdown-toggle" id="doks-languages" data-bs-toggle="dropdown" aria-expanded="false" data-bs-display="static">
{{ .Site.Params.languageISO }} {{ .Site.Params.languageISO }}
<span class="dropdown-caret"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></span> <span class="dropdown-caret"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg></span>
</button> </button>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="doks-languages"> <ul class="dropdown-menu dropdown-menu-end shadow rounded border-0" aria-labelledby="doks-languages">
<li><a class="dropdown-item current" aria-current="true" href="{{ .RelPermalink }}">{{ .Site.Language.LanguageName }}</a></li> <li><a class="dropdown-item current" aria-current="true" href="{{ .RelPermalink }}">{{ .Site.Language.LanguageName }}</a></li>
@ -101,7 +85,6 @@
--> -->
</ul> </ul>
</div> </div>
{{ end -}} {{ end -}}
</nav> </nav>
</header> </header>