How to publish a new post on this site
This post walks through the publishing workflow for this site, and since it
is an .mdx file, it also demonstrates that MDX posts work exactly like
Markdown ones.
1. Generate the post
Run the generator and answer the prompts:
npm run new-post
It asks for a title, description, tags, slug, and format (.md or .mdx),
then creates a file in src/content/blog/ with valid frontmatter and
draft: true.
2. Write and preview
Start the dev server:
npm run dev
Draft posts are visible during local development (marked with a draft
badge) but are excluded from production builds, so you can iterate on
main without publishing half-finished writing.
3. Publish
When the post is ready, open its frontmatter and change:
draft: true
to:
draft: false
Then commit, push, and deploy:
git add .
git commit -m "add new blog post"
git push
npm run build && npx wrangler deploy
wrangler deploy uploads the fresh dist/ build to Cloudflare Workers and
the post is live seconds later.
Frontmatter reference
| Field | Required | Purpose |
|---|---|---|
title | yes | Post title |
description | yes | Meta description and post-card summary |
publishedAt | yes | Publication date (YYYY-MM-DD) |
updatedAt | no | Shown as “updated” when present |
tags | no | Topic tags, normalized into /tags/ pages |
draft | no | true hides the post in production |
featured | no | Reserved for highlighting posts |
coverImage | no | Social sharing image for this post |
canonicalUrl | no | Canonical link for cross-posted articles |