--- import Avatar from './Avatar.astro'; const { pathname } = Astro.url; interface Props {} interface NavLink { label: string; path: string; } const navLinks: NavLink[] = [ { label: 'Blog', path: 'blog' }, { label: 'Now', path: 'now' }, { label: 'Projects', path: 'projects' }, ]; const pathComponents = pathname.split('/').slice(1); --- { pathComponents[0] !== '' ? ( ) : null } { navLinks.map((link) => ( {link.label} {pathComponents[0] === link.path ? ( ) : null} )) }