--- /** * PostCard Component * * Displays a post preview with optional featured image. * * IMPORTANT: Image fields are objects with { src, alt }, not strings! */ interface Props { title: string; href: string; date?: string; excerpt?: string; // Image fields from EmDash are always { src?: string, alt?: string } featuredImage?: { src?: string; alt?: string; }; } const { title, href, date, excerpt, featuredImage } = Astro.props; const formattedDate = date ? new Date(date).toLocaleDateString("en-US", { year: "numeric", month: "long", day: "numeric", }) : null; ---
{/* Check featuredImage.src, not just featuredImage */} { featuredImage?.src && ( {featuredImage.alt ) }

{title}

{formattedDate &&

{formattedDate}

} {excerpt &&

{excerpt}

}