hugo-book-theme/layouts/partials/docs/menu.html
Alex Ivanov 9cd378a2d2 Multilang (#93)
* Add i18n langs trans example
* partials
* Update sample site
* cc of variables of config
* Clean PR
* revert master data
2019-11-16 20:34:46 +01:00

29 lines
774 B
HTML

<nav>
{{ partial "docs/brand" . }}
{{ partial "docs/search" . }}
{{ partial "docs/inject/menu-before" . }}
{{ if .Site.Params.BookMenuBundle }}
{{ partial "docs/menu-bundle" . }}
{{ else }}
{{ partial "docs/menu-filetree" . }}
{{ end }}
{{ partial "docs/inject/menu-after" . }}
{{ if .Site.IsMultiLingual }}
{{ partial "docs/translation-switch" . }}
{{ partial "docs/language-switch" . }}
{{ end }}
</nav>
<!-- Restore menu position as soon as possible to avoid flickering -->
<script>
(function() {
var menu = document.querySelector("aside.book-menu nav");
addEventListener("beforeunload", function(event) {
localStorage.setItem("menu.scrollTop", menu.scrollTop);
});
menu.scrollTop = localStorage.getItem("menu.scrollTop");
})();
</script>