feat(data): add content query helpers and LLMS builder

This commit is contained in:
Prad Nukala committed 2026-08-19 14:11:46 -04:00
1 parent 85a65a16a5
commit bff9f9f999
6 files changed
+313

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
<!-- Parent: ../AGENTS.md -->
<!-- Generated: 2026-06-30 | Updated: 2026-06-30 -->
# data
## Purpose
Thin query helpers over Content Collections — draft filtering, sorting, and the experience-taxonomy aggregation.
## Key Files
| File | Description |
|------|-------------|
| `post.ts` | `getAllPosts()` (returns `CollectionEntry<"writing">`, drafts filtered in prod) and `groupPostsByYear()`. **Naming quirk:** file/functions say "post" but operate on the `writing` collection. |
| `experience.ts` | `getAllExperience()` (sorted by `startDate` desc) and `getContentForExperience(id)` which gathers all `projects`/`writing`/`speaking` entries whose `experiences` include `id`. |
| `speaking.ts` | `getAllSpeaking()` (drafts filtered in prod). |
## For AI Agents
### Working In This Directory
- Draft filtering uses `import.meta.env.PROD ? !data.draft : true` — drafts are visible in dev, hidden in production.
- `getContentForExperience` matches refs via `entry.data.experiences.some((ref) => ref.id === id)`.
## Dependencies
### Internal
- `astro:content` (`getCollection`). Consumed by pages in `src/pages/` and the homepage.
<!-- MANUAL: -->