Generate blog post metadata index for efficient querying.
npm run blog
Note: This script runs automatically before npm run build.
.tsx files in src/content/post/_data/_blog.json with compiled metadatatitle - Post titledescription - Post description/excerptdate - Publication date (YYYY-MM-DD format)categories - Array of category stringsfeaturedImage - Path to featured imageauthor - Author nameslug - Auto-generated from filename// src/content/post/my-first-post.tsxexport const metadata = {title: 'My First Blog Post',description: 'A brief description of the post for SEO and previews',date: '2025-12-04',categories: ['Technology', 'Web Development'],featuredImage: '/images/blog/first-post.jpg',author: 'John Doe',}export default function Post() {return (<article><h1>My First Blog Post</h1><p>Content goes here...</p></article>)}
Generates _data/_blog.json:
[{"slug": "my-first-post","title": "My First Blog Post","description": "A brief description...","date": "2025-12-04","categories": ["Technology", "Web Development"],"featuredImage": "/images/blog/first-post.jpg","author": "John Doe"}]
Instead of dynamically importing every blog post to list them, this script pre-generates a metadata index. This enables:
See also: