Skip to content

Commit 389c146

Browse files
committed
debug: add logging for nav active check
1 parent d865785 commit 389c146

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/components/Header.astro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { getLangFromUrl, useTranslations } from '@/i18n/utils';
77
const lang = getLangFromUrl(Astro.url);
88
const t = useTranslations(lang);
99
const pathname = Astro.url.pathname.replace(/\/$/, '') || '/';
10+
console.log('[DEBUG Header] pathname:', pathname);
1011
1112
const navigationLinks = [
1213
{ href: getRelativeLocaleUrl(lang, '/'), label: t('nav.home') },
@@ -53,6 +54,7 @@ const ctaLinks = {
5354
navigationLinks.map((link) => {
5455
const hrefStr = String(link.href);
5556
const isActive = hrefStr.replace(/\/$/, '') === pathname;
57+
console.log('[DEBUG Header] hrefStr:', hrefStr, 'isActive:', isActive);
5658
return (
5759
<li>
5860
<a

0 commit comments

Comments
 (0)