feat: add multilingual support
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
{{ define "main" }}
|
||||
<div class="row flex-xl-nowrap">
|
||||
<div class="col-lg-5 col-xl-4 docs-sidebar">
|
||||
<div class="col-lg-5 col-xl-4 docs-sidebar d-none d-lg-block">
|
||||
<nav class="docs-links" aria-label="Main navigation">
|
||||
{{ partial "sidebar/docs-menu.html" . }}
|
||||
</nav>
|
||||
@ -35,11 +35,14 @@
|
||||
{{ if .Site.Params.editPage -}}
|
||||
{{ partial "main/edit-page.html" . }}
|
||||
{{ end -}}
|
||||
{{ partial "main/docs-navigation.html" . }}
|
||||
<!--
|
||||
{{ if not .Site.Params.options.collapsibleSidebar -}}
|
||||
{{ partial "main/docs-navigation.html" . }}
|
||||
{{ else -}}
|
||||
<div class="my-n3"></div>
|
||||
{{ end -}}
|
||||
-->
|
||||
</main>
|
||||
</div>
|
||||
{{ end }}
|
@ -6,7 +6,7 @@
|
||||
</div>
|
||||
<div class="col-lg-9 col-xl-8 text-center">
|
||||
<p class="lead">{{ .Params.lead | safeHTML }}</p>
|
||||
<a class="btn btn-primary btn-lg px-4 mb-2" href="{{ "docs/prologue/introduction/" | relURL }}" role="button">Get started</a>
|
||||
<a class="btn btn-primary btn-lg px-4 mb-2" href="{{ "docs/prologue/introduction/" | relLangURL }}" role="button">{{ i18n "get-started" }}</a>
|
||||
<p class="meta">Open-source MIT Licensed. <a href="https://github.com/h-enk/doks">GitHub v{{ $data := getJSON "https://raw.githubusercontent.com/h-enk/doks/master/package.json" }}{{ $data.version }}</a></p>
|
||||
</div>
|
||||
</div>
|
||||
@ -14,38 +14,40 @@
|
||||
{{ end }}
|
||||
|
||||
{{ define "sidebar-prefooter" }}
|
||||
<section class="section section-sm">
|
||||
<div class="container">
|
||||
<div class="row justify-content-center text-center">
|
||||
<div class="col-lg-5">
|
||||
<h2 class="h4">Security aware</h2>
|
||||
<p>Get A+ scores on <a href="https://observatory.mozilla.org/analyze/doks.netlify.app">Mozilla Observatory</a> out of the box. Easily change the default Security Headers to suit your needs.</p>
|
||||
{{ if eq $.Site.Language.LanguageName "English" }}
|
||||
<section class="section section-sm">
|
||||
<div class="container">
|
||||
<div class="row justify-content-center text-center">
|
||||
<div class="col-lg-5">
|
||||
<h2 class="h4">Security aware</h2>
|
||||
<p>Get A+ scores on <a href="https://observatory.mozilla.org/analyze/doks.netlify.app">Mozilla Observatory</a> out of the box. Easily change the default Security Headers to suit your needs.</p>
|
||||
</div>
|
||||
<div class="col-lg-5">
|
||||
<h2 class="h4">Fast by default ⚡️</h2>
|
||||
<p>Get 100 scores on <a href="https://googlechrome.github.io/lighthouse/viewer/?gist=92eaa982d7dbf92f94fe8ecc03987c9a">Google Lighthouse</a> by default. Doks removes unused css, prefetches links, and lazy loads images.</p>
|
||||
</div>
|
||||
<div class="col-lg-5">
|
||||
<h2 class="h4">SEO-ready</h2>
|
||||
<p>Use sensible defaults for structured data, open graph, and Twitter cards. Or easily change the SEO settings to your liking.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-5">
|
||||
<h2 class="h4">Fast by default ⚡️</h2>
|
||||
<p>Get 100 scores on <a href="https://googlechrome.github.io/lighthouse/viewer/?gist=7731347bb8ce999eff7428a8e763b637">Google Lighthouse</a> by default. Doks removes unused css, prefetches links, and lazy loads images.</p>
|
||||
</div>
|
||||
<div class="col-lg-5">
|
||||
<h2 class="h4">SEO-ready</h2>
|
||||
<p>Use sensible defaults for structured data, open graph, and Twitter cards. Or easily change the SEO settings to your liking.</p>
|
||||
<div class="row justify-content-center text-center">
|
||||
<div class="col-lg-5">
|
||||
<h2 class="h4">Full text search</h2>
|
||||
<p>Search your Doks site with FlexSearch. Easily customize index settings and search options to your liking.</p>
|
||||
</div>
|
||||
<div class="col-lg-5">
|
||||
<h2 class="h4">Page layouts</h2>
|
||||
<p>Build pages with a landing page, blog, or documentation layout. Add custom sections and components to suit your needs.</p>
|
||||
</div>
|
||||
<div class="col-lg-5">
|
||||
<h2 class="h4">Dark mode</h2>
|
||||
<p>Switch to a low-light UI with the click of a button. Change colors with variables to match your branding.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row justify-content-center text-center">
|
||||
<div class="col-lg-5">
|
||||
<h2 class="h4">Full text search</h2>
|
||||
<p>Search your Doks site with FlexSearch. Easily customize index settings and search options to your liking.</p>
|
||||
</div>
|
||||
<div class="col-lg-5">
|
||||
<h2 class="h4">Page layouts</h2>
|
||||
<p>Build pages with a landing page, blog, or documentation layout. Add custom sections and components to suit your needs.</p>
|
||||
</div>
|
||||
<div class="col-lg-5">
|
||||
<h2 class="h4">Dark mode</h2>
|
||||
<p>Switch to a low-light UI with the click of a button. Change colors with variables to match your branding.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "sidebar-footer" }}
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
<header class="navbar navbar-expand-md navbar-light doks-navbar">
|
||||
<nav class="container-xxl flex-wrap flex-md-nowrap" aria-label="Main navigation">
|
||||
<a class="navbar-brand p-0 me-auto" href="{{ "/" | relURL }}" aria-label="Bootstrap">
|
||||
<a class="navbar-brand p-0 me-auto" href="{{ "/" | relLangURL }}" aria-label="{{ .Site.Params.Title }}">
|
||||
{{ .Site.Params.Title }}
|
||||
</a>
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
<div class="offcanvas offcanvas-start border-0 py-md-1" tabindex="-1" id="offcanvasDoks" data-bs-backdrop="true" aria-labelledby="offcanvasDoksLabel">
|
||||
<div class="header-bar d-md-none"></div>
|
||||
<div class="offcanvas-header d-md-none">
|
||||
<h2 class="h5 offcanvas-title ps-2" id="offcanvasDoksLabel"><a class="text-dark" href="{{ "/" | relURL }}">{{ .Site.Params.Title }}</a></h2>
|
||||
<h2 class="h5 offcanvas-title ps-2" id="offcanvasDoksLabel"><a class="text-dark" href="{{ "/" | relLangURL }}">{{ .Site.Params.Title }}</a></h2>
|
||||
<button type="button" class="btn-close text-reset me-2" data-bs-dismiss="offcanvas" aria-label="Close main menu"></button>
|
||||
</div>
|
||||
<div class="offcanvas-body px-4">
|
||||
@ -57,6 +57,7 @@
|
||||
{{ end -}}
|
||||
|
||||
{{ 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
|
||||
@ -70,6 +71,37 @@
|
||||
<li><a class="dropdown-item" href="/docs/contributing/how-to-contribute/">Help Translate</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
-->
|
||||
|
||||
<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">
|
||||
{{ .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>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="doks-languages">
|
||||
|
||||
<li><a class="dropdown-item current" aria-current="true" href="{{ .RelPermalink }}">{{ .Site.Language.LanguageName }}</a></li>
|
||||
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
|
||||
{{ if .IsTranslated -}}
|
||||
{{ range .Translations }}
|
||||
<li><a class="dropdown-item" rel="alternate" href="{{ .RelPermalink }}" hreflang="{{ .Lang }}" lang="{{ .Lang }}">{{ .Language.LanguageName }}</a></li>
|
||||
{{ end -}}
|
||||
{{ else -}}
|
||||
{{ range .Site.Languages -}}
|
||||
{{ if ne $.Site.Language.Lang .Lang }}
|
||||
<li><a class="dropdown-item" rel="alternate" href="{{ .Lang | relLangURL }}" hreflang="{{ .Lang }}" lang="{{ .Lang }}">{{ .LanguageName }}</a></li>
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
<!--
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a class="dropdown-item" href="/docs/contributing/how-to-contribute/">Help Translate</a></li>
|
||||
-->
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{{ end -}}
|
||||
</nav>
|
||||
</header>
|
||||
|
Reference in New Issue
Block a user