Instructions for AI coding agents working in this repository.
- Stack: Astro 6, TypeScript-enabled, static output.
- Runtime requirement: Node.js >= 22.12.0.
- Main routes:
/insrc/pages/index.astro/writinginsrc/pages/writing/index.astro/writing/[slug]insrc/pages/writing/[slug].astro
See README.md for high-level project info.
- Install:
npm install - Dev server:
npm run dev - Production build:
npm run build - Preview build:
npm run preview
- Each blog post is a folder under
src/content/blog/with anindex.mdfile. - Post assets (images, etc.) are co-located in the same folder.
- Content schema is defined in
src/content.config.ts. - Required frontmatter:
title,description,date. - Optional frontmatter:
tags,draft,canonical_url,image,image_alt. - Use relative paths for
image(e.g.image: "./cover.webp"). draft: trueposts are filtered out from both writing index and static paths.- Slugs are the folder name (the
idof the collection entry).
When changing post fields, update both markdown content and src/content.config.ts together.
- Shared page shell is
src/layouts/Base.astro. - Global stylesheet is
src/styles/global.css, imported bysrc/layouts/Base.astro(Vite-hashed on build). - Keep existing visual language and typography unless a change request explicitly asks for a redesign.
- Prefer minimal, targeted edits; avoid broad refactors.
- Preserve existing Astro + TypeScript style in each file (quote style and formatting may differ by file).
- For navigation, metadata, and shared head/body structure, modify
src/layouts/Base.astro. - For writing list behavior, modify
src/pages/writing/index.astro. - For writing page generation/rendering behavior, modify
src/pages/writing/[slug].astro.
- Run
npm run buildafter structural/template/content-collection changes. - If touching writing pages, verify draft filtering still works.
- If touching global styles, verify the edited file is the one actually loaded by the layout.