mirror of
https://github.com/Xevion/utsa-handbook.git
synced 2025-12-15 10:13:42 -06:00
undefined check for link.link, remove heroImage
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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} />
|
||||
|
||||
Reference in New Issue
Block a user