Content Collectionsで記事を管理する
📖 1分で読めます
Content Collections とは
Content Collections は、Astro が提供するコンテンツ管理の仕組みです。 Zod スキーマによるバリデーションと TypeScript の型推論が特徴です。
基本的な使い方
content.config.ts でコレクションを定義し、
getCollection() でデータを取得します。
まとめ
Content Collections を使えば、フロントマターの不備をビルド時に検出できます。