From 404d477e7f34f96d758fb55a02c46f55f238cc28 Mon Sep 17 00:00:00 2001 From: Stefan Imhoff Date: Tue, 4 Feb 2025 20:07:43 +0100 Subject: [PATCH] feat(a11y): add aria-current to navigation --- src/components/Scripts.astro | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/Scripts.astro b/src/components/Scripts.astro index 8ad731f..814f64c 100644 --- a/src/components/Scripts.astro +++ b/src/components/Scripts.astro @@ -10,8 +10,10 @@ links.forEach((link) => { if (link.getAttribute('href') === currentPath) { link.classList.add('is-active'); + link.setAttribute('aria-current', 'page'); } else { link.classList.remove('is-active'); + link.removeAttribute('aria-current'); } }); }