Type to search. Arrow keys to move, Enter to open, Esc to close.

All technologies

Content collections

Structured content in files, one collection per type, validated by a schema at build time, so pages read typed data instead of hard-coded values.

Project requirement

Keep the portfolio's projects, technologies, research and certificates separate from code, but typed and checked.

Technical question

How can content stay in plain files without broken or missing fields reaching the live site?

Validation

Four JSON collections with zod schemas; a wrong or missing field fails the build. Relations are stored as identifiers and drive the detail pages, the search index and the graph.

Decision

The schema is the source of truth: required fields, defaults and formats live there, and one new file updates every page that uses it.

Relations are identifiers, for example a project lists the technology notes it uses. A missing target is skipped by the views rather than failing the build, so identifiers need care.

The entry id comes from the file name; a dotted name loses its dots, so file names use hyphens.

Implementations by language

TypeScript

Astro content collections with the glob loader and zod schemas in src/content.config.ts; views read them with getCollection and getEntry, and dynamic routes are generated from the collection ids.

  • In Astro 7, z is imported from astro/zod.
  • The glob loader turns drntth.github.io into the id drntthgithubio.

Used by projects