Skip to content

Commit

Permalink
Merge pull request #477 from digitalnsw/update/docs-custom-url
Browse files Browse the repository at this point in the history
Removes condition for active nav links
  • Loading branch information
oisa authored Oct 18, 2024
2 parents 227c053 + 11947eb commit 32dff8c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/docs/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 32dff8c

Please sign in to comment.