adjust file structure
This commit is contained in:
13
assets/js/global.js
Normal file
13
assets/js/global.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const parser = new DOMParser();
|
||||
|
||||
fetch("/_bottomnav.html")
|
||||
.then(response => response.text())
|
||||
.then(text => {
|
||||
const bottomNavHTML = parser.parseFromString(text, "text/html");
|
||||
const bottomNav = bottomNavHTML.getElementById("bottomnav");
|
||||
|
||||
const pathSpan = bottomNav.querySelector("span");
|
||||
pathSpan.innerText = pathSpan.innerText.replace("%PATH%", document.location.pathname);
|
||||
|
||||
document.body.appendChild(bottomNav);
|
||||
});
|
||||
Reference in New Issue
Block a user