My website, rebuilt yet again
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 14 lines 441 B view raw
1--- 2import type { HTMLAttributes } from 'astro/types'; 3 4type Props = HTMLAttributes<'a'>; 5 6const { href, class: className, ...props } = Astro.props; 7const pathname = Astro.url.pathname.replace(import.meta.env.BASE_URL, ''); 8const subpath = pathname.match(/[^\/]+/g); 9const isActive = href === pathname || href === '/' + (subpath?.[0] || ''); 10--- 11 12<a href={href} class:list={[className, { 'font-bold': isActive }]} {...props}> 13 <slot /> 14</a>