diff --git a/src/components/navbar.js b/src/components/navbar.js index f52df24..1756269 100644 --- a/src/components/navbar.js +++ b/src/components/navbar.js @@ -1,9 +1,9 @@ import ComponentBuilder from './component-builder.js' // fix links for nested pages -const slashCount = document.location.pathname.split('/').length - 1 -const linkPrefix = '../'.repeat(slashCount - 2) - +const location = document.location.pathname.split('src')[1] +const slashCount = location.split('/').length - 1 +const linkPrefix = '../'.repeat(slashCount - 1) const navbarCode = `