From b0a149260a07764fb35960d83be649bbb41692ed Mon Sep 17 00:00:00 2001 From: Xevion Date: Sun, 10 Mar 2024 08:54:49 -0500 Subject: [PATCH] undefined check for link.link, remove heroImage --- src/components/Sidebar.astro | 5 +++-- src/pages/handbook/index.astro | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Sidebar.astro b/src/components/Sidebar.astro index 49046d0..0b048eb 100644 --- a/src/components/Sidebar.astro +++ b/src/components/Sidebar.astro @@ -1,12 +1,13 @@ --- -import get, {Link} from '@/content/sidebar'; +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 !== null ? link.link.includes(currentPageMatch) : false; + const isCurrent = link.link !== undefined ? link.link.includes(currentPageMatch) : false; return clsx(baseClasses, { // Classes for when the link is not the current page diff --git a/src/pages/handbook/index.astro b/src/pages/handbook/index.astro index ff86142..f7e0ed1 100644 --- a/src/pages/handbook/index.astro +++ b/src/pages/handbook/index.astro @@ -93,7 +93,6 @@ const posts = (await getCollection('handbook')).sort( posts.map((post) => (
  • -

    {post.data.title}