Files
website/src/pages/index.astro
T

85 lines
2.4 KiB
Plaintext
Raw Normal View History

---
import { type CollectionEntry, getCollection } from "astro:content";
import PostPreview from "@/components/blog/PostPreview.astro";
2026-06-30 12:03:32 -04:00
import Project from "@/components/project/Project.astro";
import SocialList from "@/components/SocialList.astro";
import { getAllPosts } from "@/data/post";
2026-06-30 12:03:32 -04:00
import { getAllSpeaking } from "@/data/speaking";
import PageLayout from "@/layouts/Base.astro";
import { collectionDateSort } from "@/utils/date";
2026-06-30 12:03:32 -04:00
const MAX_POSTS = 5;
const allPosts = await getAllPosts();
2026-06-30 12:03:32 -04:00
const latestPosts = (allPosts.sort(collectionDateSort) as CollectionEntry<"writing">[]).slice(
0,
MAX_POSTS,
);
2026-06-30 12:03:32 -04:00
const MAX_PROJECTS = 3;
const allProjects = await getCollection("projects");
const latestProjects = allProjects
.sort(collectionDateSort)
2026-06-30 12:03:32 -04:00
.slice(0, MAX_PROJECTS) as CollectionEntry<"projects">[];
const MAX_TALKS = 3;
const latestTalks = (await getAllSpeaking()).sort(collectionDateSort).slice(0, MAX_TALKS);
---
<PageLayout meta={{ title: "Home" }}>
<section>
2026-06-30 12:03:32 -04:00
<h1 class="title mb-6">Prad Nukala</h1>
<p class="mb-4">
2026-06-30 12:03:32 -04:00
Engineer and founder. I build decentralized identity infrastructure and tools for developers.
Here you'll find what I've built, where I've worked, what I write, and the talks I've given.
</p>
<SocialList />
</section>
{
2026-06-30 12:03:32 -04:00
latestProjects.length > 0 && (
<section class="mt-16">
2026-06-30 12:03:32 -04:00
<h2 class="title text-accent mb-6 text-xl">
<a href="/projects/">Projects</a>
</h2>
<ul class="space-y-6" role="list">
{latestProjects.map((project) => (
<li>
<Project project={project} as="h3" isPreview />
</li>
))}
</ul>
</section>
)
}
<section class="mt-16">
2026-06-30 12:03:32 -04:00
<h2 class="title text-accent mb-6 text-xl"><a href="/writing/">Writing</a></h2>
<ul class="space-y-4" role="list">
{
latestPosts.map((p) => (
<li class="grid gap-1 sm:grid-cols-[auto_1fr]">
<PostPreview post={p} />
</li>
))
}
</ul>
</section>
{
2026-06-30 12:03:32 -04:00
latestTalks.length > 0 && (
<section class="mt-16">
<h2 class="title text-accent mb-6 text-xl">
2026-06-30 12:03:32 -04:00
<a href="/speaking/">Speaking</a>
</h2>
2026-06-30 12:03:32 -04:00
<ul class="space-y-4" role="list">
{latestTalks.map((talk) => (
<li>
2026-06-30 12:03:32 -04:00
<a class="cactus-link" href={`/speaking/${talk.id}/`}>
{talk.data.title}
</a>
{talk.data.event && <span class="text-muted text-sm"> · {talk.data.event}</span>}
</li>
))}
</ul>
</section>
)
}
</PageLayout>