--- import get from '@/content/sidebar'; import type { Link } from '@/content/sidebar'; import clsx from 'clsx'; const { currentPage } = Astro.props; const currentPageMatch = currentPage.slice(1); const getLinkClasses = (link: Link) => { const baseClasses = "block py-2 px-6 my-1 transition-colors border-l hover:border-zinc-400 hover:text-slate-900" const isCurrent = link.link !== undefined ? link.link.includes(currentPageMatch) : false; return clsx(baseClasses, { // Classes for when the link is not the current page "dark:border-l-zinc-600 text-zinc-500 dark:hover:text-zinc-300 dark:text-zinc-400": !isCurrent, // Classes for when the link is the current page "dark:border-l-zinc-500 text-zinc-900 dark:text-zinc-200": isCurrent, }); } const sidebar = await get(); ---