active link style

This commit is contained in:
itsMapleLeaf
2023-03-12 16:14:46 -05:00
parent 6da6008d2c
commit 84348d287f
5 changed files with 46 additions and 32 deletions

View File

@@ -4,6 +4,7 @@ import { getCollection, type CollectionEntry } from "astro:content"
import AppFooter from "~/components/app-footer.astro"
import Layout from "~/components/layout.astro"
import MainNavigation from "~/components/main-navigation.astro"
import NavLink from "~/components/nav-link.astro"
export type Props = {
guide: CollectionEntry<"guides">
@@ -37,9 +38,13 @@ const { Content } = await Astro.props.guide.render()
{
guides.map((guide) => (
<li>
<a class="link" href={`/guides/${guide.slug}`} rel="prefetch">
<NavLink
class="link data-[active]:link-active"
href={`/guides/${guide.slug}`}
rel="prefetch"
>
{guide.data.title}
</a>
</NavLink>
</li>
))
}