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

This commit is contained in:
Bob Vandevliet 2025-12-18 13:23:40 +01:00
parent f35da10e0e
commit 8a2835a13e

View file

@ -44,17 +44,6 @@ document.addEventListener('DOMContentLoaded', () =>
// Update nav links and add anchor links to section headers. // Update nav links and add anchor links to section headers.
sectionsWithId.forEach(anchorTarget => 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} * @type {HTMLHeadingElement|null}
*/ */