Skip to content

Commit

Permalink
docs: fix highlight of current aside menu item
Browse files Browse the repository at this point in the history
  • Loading branch information
cyjake committed Oct 16, 2023
1 parent 3efd672 commit ef47941
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/assets/javascript/app.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function main() {
Array.from(document.querySelectorAll('#header nav a'), function markActive(el) {
if (location.pathname.startsWith(el.getAttribute('href'))) {
if (location.pathname.replace(/\/$/, '') === el.getAttribute('href')) {
el.classList.add('active');
const trigger = el.closest('.dropdown-trigger');
if (trigger) trigger.classList.add('active');
Expand Down

0 comments on commit ef47941

Please sign in to comment.