EXAMPLE ARTICLE / PUBLISHING GUIDE
How to publish a post on this site
An example article and a practical guide to writing, previewing, and publishing with Astro Content Collections.
Example article: This is a publishing guide included with the site. It is not a personal story or a record of professional experience. Edit or remove it when you are ready to publish your own writing.
This blog is built from Markdown files. There is no database to maintain and no separate publishing service to sign into. Each article lives alongside the site’s source code.
Create a draft
From the project directory, run:
npm run post:new -- "My first article"
The command creates src/content/blog/my-first-article.md with the required frontmatter and draft: true. You can also create a Markdown or MDX file in that directory yourself. Its filename becomes the URL slug.
Fill in the metadata
Each post starts with YAML frontmatter:
---
title: 'My first article'
description: 'A short, specific summary of the article.'
publishDate: 2026-11-22
# updatedDate: 2026-11-23
tags: [Architecture, Engineering]
draft: true
# cover: ../../assets/my-cover.jpg
# coverAlt: "A meaningful description of the cover image"
# seoTitle: "An optional title for search results"
# seoDescription: "An optional search and social description"
---
Use ISO dates (YYYY-MM-DD). Add an updatedDate when you revise a published article. The site estimates reading time automatically. If you add a cover image, include descriptive coverAlt text; local images are optimized during the build.
Write in Markdown
Use a single page title in the frontmatter, then begin article sections with level-two headings (##). Links, lists, blockquotes, and fenced code blocks are supported.
function greet(name: string): string {
return `Hello, ${name}!`;
}
Code blocks use syntax highlighting. For longer articles with at least three section headings, the site generates a table of contents. You can use MDX when an article needs an Astro component.
Preview your writing
npm run dev
Draft posts and future-dated posts stay out of the public site, RSS feed, homepage, and generated article routes. To preview a draft locally, temporarily set draft: false and use today’s date or an earlier publication date. Restore the draft flag before committing if the article is not ready.
Publish
- Set
draft: falsewhen the article is ready. - Check that the publication date is not in the future.
- Run
npm run checkandnpm run build. - Commit the Markdown file and any images to GitHub.
- Push to the branch connected to Cloudflare Pages.
Cloudflare builds the updated site. The article appears in the blog listing and RSS feed, and the sitemap includes its URL. Related articles are chosen from other published posts, prioritizing shared tags.
A static site publishes future-dated articles only after a new build runs on or after their publication date. The date alone does not trigger a deployment.
Make it your own
Replace this example with your first real post whenever you are ready. Keep descriptions specific, use useful headings, and choose a few consistent tags so related writing is easy to find.