feat(docs): add astro routes for experience, projects, speaking, and writing pages

This commit is contained in:
Prad Nukala
2026-06-30 12:03:20 -04:00
parent 2760ea960e
commit 22fceb787b
10 changed files with 504 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
---
import { getCollection, render } from "astro:content";
import type { GetStaticPaths, InferGetStaticPropsType } from "astro";
import ExperienceTags from "@/components/ExperienceTags.astro";
import FormattedDate from "@/components/FormattedDate.astro";
import StreamPlayer from "@/components/StreamPlayer.astro";
import PageLayout from "@/layouts/Base.astro";
export const getStaticPaths = (async () => {
const talks = await getCollection("speaking");
return talks.map((talk) => ({
params: { slug: talk.id },
props: { talk },
}));
}) satisfies GetStaticPaths;
type Props = InferGetStaticPropsType<typeof getStaticPaths>;
const { talk } = Astro.props as Props;
const { Content } = await render(talk);
const { title, description, videoId, originalSource, event, publishDate, experiences } = talk.data;
const meta = { description, title };
---
<PageLayout meta={meta}>
<article data-pagefind-body>
<h1 class="title mb-2">{title}</h1>
<p class="text-muted mb-6">
<FormattedDate date={publishDate} />{event && ` · ${event}`}
</p>
<StreamPlayer videoId={videoId} title={title} />
{
originalSource && (
<p class="text-muted mt-3 text-sm">
<a class="cactus-link" href={originalSource} rel="noopener noreferrer" target="_blank">
Watch original on YouTube →
</a>
</p>
)
}
<div class="prose prose-sm prose-cactus mt-8 max-w-none">
<Content />
</div>
{experiences.length > 0 && <div class="mt-8"><ExperienceTags experiences={experiences} /></div>}
</article>
</PageLayout>