UNPKG

@twyr/announce

Version:

CLI Tool and NPM Library for announcing a release on Github / Gitlab / etc. and on NPM

13 lines (11 loc) 368 B
function scrollToNavItem() { var path = window.location.href.split('/').pop().replace(/\.html/, ''); document.querySelectorAll('nav a').forEach(function(link) { var href = link.attributes.href.value.replace(/\.html/, ''); if (path === href) { link.scrollIntoView({block: 'center'}); return; } }) } scrollToNavItem();