learnings
MDX Content Pipeline
October 02, 2024
Notes on validating content metadata and compiling MDX in the App Router.
- #mdx
- #nextjs
- #zod
When content lives in Git, schemas keep things honest. Zod gives immediate feedback when required fields go missing.
Front matter is enforced at build time, so invalid posts never ship.
Key takeaways:
- Keep collections explicit to avoid typos.
- Normalize dates to JavaScript
Dateinstances for consistent sorting. - Reuse remark/rehype configuration between the Next.js compiler and runtime transforms.
Further exploration