joatandev

← Back to blog

How to publish a new post on this site

· 1 min read

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

FieldRequiredPurpose
titleyesPost title
descriptionyesMeta description and post-card summary
publishedAtyesPublication date (YYYY-MM-DD)
updatedAtnoShown as “updated” when present
tagsnoTopic tags, normalized into /tags/ pages
draftnotrue hides the post in production
featurednoReserved for highlighting posts
coverImagenoSocial sharing image for this post
canonicalUrlnoCanonical link for cross-posted articles