diff --git a/layouts/partials/js-global.html b/layouts/partials/js-global.html
index 4179e63..f12cff6 100644
--- a/layouts/partials/js-global.html
+++ b/layouts/partials/js-global.html
@@ -2,6 +2,7 @@
function openNavDrawer() {
navDrawerOverlay.classList.toggle('d-none')
navDrawer.style.transform = 'translate(0)'
+ window.location.hash = '#nav'
}
function closeNavDrawer() {
@@ -62,5 +63,17 @@
}
setThemeTo(th)
initToggle(th)
+ closeNavDrawer()
})()
+
+ if (window.location.hash == '#nav') {
+ history.replaceState("", document.title, window.location.pathname);
+ }
+
+ window.addEventListener('hashchange', function(e) {
+ if (window.location.hash == '') {
+ closeNavDrawer()
+ history.replaceState("", document.title, window.location.pathname);
+ }
+ })