mirror of
https://github.com/prdlk/website.git
synced 2026-08-02 17:31:41 +00:00
3.0 KiB
3.0 KiB
src
Purpose
All application source: configuration, content collections, pages/routes, layouts, components, data helpers, styles, and build plugins.
Key Files
| File | Description |
|---|---|
site.config.ts |
Site metadata (siteConfig), socialLinks, menuLinks, and Expressive Code options. Primary place to edit site-wide settings. |
content.config.ts |
Content Collection definitions + Zod schemas for writing, projects, experience, speaking. Experience refs are validated via reference("experience"). |
types.ts |
Shared TS types (SiteConfig, SiteMeta, webmention types, AdmonitionType). |
env.d.ts |
Ambient type declarations. |
Subdirectories
| Directory | Purpose |
|---|---|
assets/ |
Build-time assets, currently OG fonts (see assets/AGENTS.md). |
components/ |
Reusable .astro components (see components/AGENTS.md). |
content/ |
Markdown content for the four collections (see content/AGENTS.md). |
data/ |
Collection query helpers (see data/AGENTS.md). |
layouts/ |
Page shells (see layouts/AGENTS.md). |
pages/ |
File-based routes + endpoints. No AGENTS.md here — any .md under src/pages becomes a public route, so docs for this dir live in this file (see "Routing & OG images" below). |
plugins/ |
Custom remark plugins (see plugins/AGENTS.md). |
styles/ |
Global CSS + block/component styles (see styles/AGENTS.md). |
utils/ |
Pure helper functions (see utils/AGENTS.md). |
For AI Agents
Working In This Directory
- Collection keys match their content dir and route:
writing→/writing,projects→/projects,experience→/experience,speaking→/speaking. - When changing a collection schema in
content.config.ts, runpnpm buildto regenerateastro:contenttypes and catch frontmatter mismatches.
Routing & OG images (src/pages)
- Any
.md/.mdx/.astroundersrc/pagesbecomes a route — do not putAGENTS.mdor other docs there (they'd ship as public pages). Documentpages/here instead. - Each section has
[...page].astro(paginated list) +[...slug].astro(detail); plusrss.xml.tsfeeds and a dynamic OG-image endpoint. og-image/[...slug].png.tsgenerates per-entry social images for all collections (namespaced/og-image/<type>/<id>.png) via Satori + Sharp, cached by_cacheUtil.ts(bumpCACHE_VERSIONwhen changing_ogMarkup.ts). Files prefixed_are private modules, not routes.- The
/experience/[...slug]page is the taxonomy hub (getContentForExperience), listing related projects/writing/talks.
Common Patterns
- The
experiencesfrontmatter array (on projects/writing/speaking) holdsreference("experience")entries, resolved withgetEntries.
Dependencies
Internal
- Nearly everything imports
@/site.configand@/content.config-derived collection types.