diff --git a/js/main.js b/js/main.js index 33175a5..091012d 100644 --- a/js/main.js +++ b/js/main.js @@ -53,8 +53,18 @@ function setPage(path){ window.scrollTo(0, 0); $("#article-container").empty(); + + $("#left > a").each((i, elmt) => { + let hrefPath = elmt.attributes["href"].value; + if(hrefPath === "/" || path === "" || path === "/index.html") + hrefPath = "/home"; + + $(elmt).toggleClass("active", hrefPath === path); + }); + $.ajax("/pages"+path+".md") .done((res) => { + $("#article-container").html(res); const len = $("#article-container > article").length;