undefined check for link.link, remove heroImage

This commit is contained in:
2024-03-10 08:54:49 -05:00
parent a9e1b7bbce
commit b0a149260a
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -93,7 +93,6 @@ const posts = (await getCollection('handbook')).sort(
posts.map((post) => (
<li>
<a href={`/handbook/${post.slug}/`}>
<img width={720} height={360} src={post.data.heroImage} alt="" />
<h4 class="title">{post.data.title}</h4>
<p class="date">
<FormattedDate date={post.data.pubDate} />