From 08d189a8582f91ce917755a335e1dcb77aeaa0c5 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 29 Oct 2021 15:08:21 +0200 Subject: chore: keep projects url consistent Since I added legal notice, project hash could be added to legal notice page. Instead I make sure it is only added to website root. --- htdocs/src/js/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'htdocs/src/js/app.js') diff --git a/htdocs/src/js/app.js b/htdocs/src/js/app.js index 57ac458..38aee0e 100644 --- a/htdocs/src/js/app.js +++ b/htdocs/src/js/app.js @@ -246,7 +246,7 @@ function showProject(id) { name: currentProject.name, }); detailsBtn.addEventListener('click', toggleProjectDetails); - window.history.pushState({}, currentProject.name, `#${id}`); + window.history.pushState({}, currentProject.name, `/#${id}`); document.title = `${currentProject.name} | Demo | Armand Philippot`; main.replaceChildren(preview, details); } @@ -276,7 +276,7 @@ function getProjectsNavItem(id, name) { const item = document.createElement('li'); const link = document.createElement('a'); link.classList.add('nav__link'); - link.href = `#${id}`; + link.href = `/#${id}`; link.id = id; link.textContent = name; link.addEventListener('click', (e) => { -- cgit v1.2.3