diff --git a/src/docs/docs.js b/src/docs/docs.js index bfec7488..e778be70 100644 --- a/src/docs/docs.js +++ b/src/docs/docs.js @@ -50,11 +50,11 @@ function initDocs() { const navLinks = document.querySelectorAll('.nsw-docs__nav a') let currentURL = window.location.pathname - if (currentURL === '/' || currentURL === 'https://designsystem.digital.nsw.gov.au') currentURL = '/home/index.html' + if (currentURL === '/') currentURL = '/home/index.html' navLinks.forEach((link) => { - let linkURL = link.getAttribute('href') - if (linkURL == '/' || linkURL == 'https://designsystem.digital.nsw.gov.au') linkURL = '/home/index.html' + let linkURL = link.getAttribute('href').replace('https://designsystem.digital.nsw.gov.au', '') + if (linkURL == '/') linkURL = '/home/index.html' if (currentURL.match(linkURL)) { link.classList.add('current')