fix: .gitignore

This commit is contained in:
Prad Nukala
2026-06-30 12:03:32 -04:00
parent 22fceb787b
commit 4422ff4410
23 changed files with 1000 additions and 905 deletions
+34 -34
View File
@@ -1,52 +1,49 @@
---
import { type CollectionEntry, getCollection } from "astro:content";
import PostPreview from "@/components/blog/PostPreview.astro";
import Note from "@/components/note/Note.astro";
import Project from "@/components/project/Project.astro";
import SocialList from "@/components/SocialList.astro";
import { getAllPosts } from "@/data/post";
import { getAllSpeaking } from "@/data/speaking";
import PageLayout from "@/layouts/Base.astro";
import { collectionDateSort } from "@/utils/date";
// Posts
const MAX_POSTS = 10;
const MAX_POSTS = 5;
const allPosts = await getAllPosts();
const allPostsByDate = allPosts.sort(collectionDateSort) as CollectionEntry<"post">[];
const latestPosts = allPostsByDate.slice(0, MAX_POSTS);
const latestPosts = (allPosts.sort(collectionDateSort) as CollectionEntry<"writing">[]).slice(
0,
MAX_POSTS,
);
// Pinned Posts, set to a max of 3;
const MAX_PINNED_POSTS = 3;
const pinnedPosts = allPostsByDate
.values()
.filter((p) => p.data.pinned)
.take(MAX_PINNED_POSTS)
.toArray();
// Notes, set to a max of 5
const MAX_NOTES = 5;
const allNotes = await getCollection("note");
const latestNotes = allNotes
const MAX_PROJECTS = 3;
const allProjects = await getCollection("projects");
const latestProjects = allProjects
.sort(collectionDateSort)
.slice(0, MAX_NOTES) as CollectionEntry<"note">[];
.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>
<h1 class="title mb-12">Hello World!</h1>
<h1 class="title mb-6">Prad Nukala</h1>
<p class="mb-4">
Hi, Im a theme for Astro, a simple starter that you can use to create your website or blog.
If you want to know more about how you can customise me, add more posts, and make it your own,
click on the GitHub icon link below and it will take you to my repo.
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>
{
pinnedPosts.length > 0 && (
latestProjects.length > 0 && (
<section class="mt-16">
<h2 class="title mb-6 text-xl">Pinned Posts</h2>
<ul class="space-y-4" role="list">
{pinnedPosts.map((p) => (
<li class="grid gap-1 sm:grid-cols-[auto_1fr]">
<PostPreview post={p} />
<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>
@@ -54,7 +51,7 @@ const latestNotes = allNotes
)
}
<section class="mt-16">
<h2 class="title text-accent mb-6 text-xl"><a href="/posts/">Posts</a></h2>
<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) => (
@@ -66,15 +63,18 @@ const latestNotes = allNotes
</ul>
</section>
{
latestNotes.length > 0 && (
latestTalks.length > 0 && (
<section class="mt-16">
<h2 class="title text-accent mb-6 text-xl">
<a href="/notes/">Notes</a>
<a href="/speaking/">Speaking</a>
</h2>
<ul class="space-y-6" role="list">
{latestNotes.map((note) => (
<ul class="space-y-4" role="list">
{latestTalks.map((talk) => (
<li>
<Note note={note} as="h3" isPreview />
<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>