Revert "Consistent linking, less confusing, partial revert of 0e82abef."

This reverts commit 8a2835a13e.
This commit is contained in:
Bob Vandevliet 2026-02-04 17:24:17 +01:00
parent adfd9bb4b7
commit c187f29e4b

View file

@ -44,6 +44,17 @@ document.addEventListener('DOMContentLoaded', () =>
// Update nav links and add anchor links to section headers.
sectionsWithId.forEach(anchorTarget =>
{
// Navigate within current page if a section for the anchor exists.
navLinks.forEach(navLink =>
{
const href = navLink.getAttribute('href');
if (href.startsWith('/#') && href.substring(2) === anchorTarget.id)
{
navLink.setAttribute('href', href.substring(1));
}
});
/**
* @type {HTMLHeadingElement|null}
*/