Start work on search feature with lunr
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<nav>
|
||||
{{ partial "docs/brand" . }}
|
||||
{{ partial "docs/search" . }}
|
||||
{{ partial "docs/inject/menu-before" . }}
|
||||
|
||||
{{ if .Site.Params.BookMenuBundle }}
|
||||
@@ -11,6 +12,13 @@
|
||||
{{ partial "docs/inject/menu-after" . }}
|
||||
</nav>
|
||||
|
||||
{{ if .Site.Params.BookEnableJS }}
|
||||
{{ template "jsmenu" . }}
|
||||
{{ end }}
|
||||
<!-- 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>
|
||||
|
||||
Reference in New Issue
Block a user