--- import { type CollectionEntry, getEntries, render } from "astro:content"; import type { HTMLTag, Polymorphic } from "astro/types"; import TagList from "@/components/TagList.astro"; type Props = Polymorphic<{ as: Tag }> & { project: CollectionEntry<"projects">; isPreview?: boolean | undefined; }; const { as: Tag = "div", project, isPreview = false } = Astro.props; const { Content } = await render(project); const { title, startDate, endDate, link, repo, tags, experiences } = project.data; const range = `${startDate.getFullYear()} – ${endDate ? endDate.getFullYear() : "Present"}`; const expEntries = experiences.length ? await getEntries(experiences) : []; ---
{ isPreview ? ( {title} ) : ( <>{title} ) }

{range}{expEntries.length > 0 && ( ({expEntries.map((exp, i) => ( {i > 0 && ", "}{exp.data.title} ))}) )}

{ !isPreview && (link || repo) && (
{link && ( Visit → )} {repo && ( Source → )}
) }
{ !isPreview && tags.length > 0 && ( ) }