mirror of
https://github.com/alex-shpak/hugo-book.git
synced 2024-11-25 20:56:43 +00:00
25 lines
644 B
HTML
25 lines
644 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" . }}
|
|
</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>
|