--- import { render } from "astro:content"; import type { GetStaticPaths, InferGetStaticPropsType } from "astro"; import { Icon } from "astro-icon/components"; import PostPreview from "@/components/blog/PostPreview.astro"; import TagList from "@/components/TagList.astro"; import { getAllExperience, getContentForExperience } from "@/data/experience"; import PageLayout from "@/layouts/Base.astro"; import { breadcrumbList } from "@/utils/seo"; export const getStaticPaths = (async () => { const experiences = await getAllExperience(); return Promise.all( experiences.map(async (exp) => ({ params: { slug: exp.id }, props: { exp, content: await getContentForExperience(exp.id) }, })), ); }) satisfies GetStaticPaths; type Props = InferGetStaticPropsType; const { exp, content } = Astro.props as Props; const { Content } = await render(exp); const { startDate, endDate, organization, role, location, url, tags } = exp.data; const range = `${startDate.getFullYear()} – ${endDate ? endDate.getFullYear() : "Present"}`; const meta = { description: exp.data.description ?? `${role ?? ""} at ${organization}`.trim(), keywords: tags, ogImage: `/og-image/experience/${exp.id}.png`, schema: breadcrumbList([ { name: "Home", path: "/" }, { name: "Experience", path: "/experience/" }, { name: exp.data.title, path: `/experience/${exp.id}/` }, ]), title: exp.data.title, }; ---

{role ? `${role}, ${organization}` : organization}

{range}{location && ` · ${location}`} { url && ( <> {" · "} Website → ) }

{ content.projects.length > 0 && (

Projects

) } { content.writing.length > 0 && (

Writing

    {content.writing.map((p) => (
  • ))}
) } { content.speaking.length > 0 && (

Speaking

) }