Skip to content

Commit 5acf8b2

Browse files
committed
toggle by default
Signed-off-by: Max Pumperla <max.pumperla@googlemail.com>
1 parent 0a435da commit 5acf8b2

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

_config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ html:
77
theme_switcher: false
88
extra_css:
99
- custom_hide.css
10+
extra_js:
11+
- custom_toggle.js

custom_toggle.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// custom_toggle.js
2+
window.addEventListener("DOMContentLoaded", function () {
3+
// Find the sidebar toggle button (hamburger menu)
4+
var toggle = document.querySelector(
5+
".sidebar-toggle, .bd-sidebar-primary-toggle"
6+
);
7+
// If the sidebar is open, click to close it
8+
if (toggle) {
9+
if (document.body.classList.contains("bd-sidebar-primary--visible")) {
10+
toggle.click();
11+
}
12+
}
13+
});

0 commit comments

Comments
 (0)