We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0a435da commit 5acf8b2Copy full SHA for 5acf8b2
_config.yml
@@ -7,3 +7,5 @@ html:
7
theme_switcher: false
8
extra_css:
9
- custom_hide.css
10
+ extra_js:
11
+ - custom_toggle.js
custom_toggle.js
@@ -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
+ );
+ // If the sidebar is open, click to close it
+ if (toggle) {
+ if (document.body.classList.contains("bd-sidebar-primary--visible")) {
+ toggle.click();
+ }
12
13
+});
0 commit comments