Skip to content
This repository was archived by the owner on Feb 12, 2026. It is now read-only.

Commit 2d1fb43

Browse files
committed
fixed navbar highlighting
1 parent 295bd90 commit 2d1fb43

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

js/navbar-highlight.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
const currentPath = window.location.pathname.replace(/\/$/, '');
1+
const currentPath = window.location.pathname.replace(/\/$/, '') || '/';
22

33
document.querySelectorAll('.navbar a').forEach(link => {
44
const href = link.getAttribute('href');
55

6-
if (!href) return;
6+
if (!href || href === '#') return;
77

88
const normalizedHref = href.length > 1 ? href.replace(/\/$/, '') : href;
99

0 commit comments

Comments
 (0)