Skip to content

Commit

Permalink
update navigation item active state check to use relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
hugh5 committed Nov 11, 2024
1 parent 42b158e commit 4b77a8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function loadNav() {
// Highlight the active nav item based on the current page
$("nav > .menu-item").each(function () {
const href = $(this).attr("href");
if ("/" + page === href) {
if ("./" + page === href) {
$(this).addClass("active");
}
});
Expand Down

0 comments on commit 4b77a8f

Please sign in to comment.