на чистом жс можно так [...document.querySelectorAll('nav a[href^="/' + location.pathname.split("/")[1] + '"]')].forEach(node => {node.classList.add('current-page')})
на чистом жс можно так [...document.querySelectorAll('nav a[href^="/' + location.pathname.split("/")[1] + '"]')].forEach(node => {node.classList.add('current-page')})