Skip to content

Commit 2b3fd13

Browse files
committed
feat: navigation-expand added programmatically to blog page for expanding categories
1 parent 3045199 commit 2b3fd13

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
document.addEventListener("DOMContentLoaded", function () {
2+
// Check if we are on the home page
3+
if (window.location.pathname === "/" || window.location.pathname.endsWith("index.html")) {
4+
document.querySelectorAll(".md-nav__toggle").forEach((el) => {
5+
el.checked = true; // Expand all categories
6+
});
7+
}
8+
});

mkdocs.yml

+4
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ theme:
4141
name: Switch to light mode
4242
features:
4343
- navigation.tabs
44+
# - navigation.sections
4445
#- navigation.tabs.sticky
4546
- navigation.path
4647
- navigation.top
4748
- navigation.indexes
4849
- navigation.instant.progress
4950
- navigation.path
51+
# - navigation.expand
5052
- header
5153
- search.suggest
5254
- search.share
@@ -61,6 +63,8 @@ extra_css:
6163

6264
extra_javascript:
6365
- https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/js/all.min.js
66+
- assets/javascripts/navigation-expand.js
67+
6468

6569
hooks:
6670
- hooks/socialmedia.py

0 commit comments

Comments
 (0)