New Blog Post
Create a new blog post file in src/content/blog/.
Arguments
The user provides a title. If not provided, ask for one.
Steps
- •Take the title and generate a URL-friendly slug (lowercase, hyphens, no special chars).
- •Create
src/content/blog/<slug>.mdwith this frontmatter:
yaml
--- title: <Title> date: <today's date as YYYY-MM-DD> tags: [] draft: true description: ---
- •Leave the body empty after the frontmatter closing
---. - •Tell the user the file was created and remind them to:
- •Add tags (array of strings)
- •Write a description (optional but recommended)
- •Set
draft: falsewhen ready to publish
Schema Reference
From src/content.config.ts, the blog schema is:
- •
title: string (required) - •
date: date (required, coerced) - •
tags: string[] (defaults to[]) - •
draft: boolean (defaults tofalse) - •
description: string (optional)
Important
- •Always set
draft: truefor new posts so they don't accidentally publish. - •Use today's date (YYYY-MM-DD format).
- •The slug should match the filename exactly.