MyPlace.com | Home Help | Sign Up

Writing Your First Blog Entry

How to add blog posts using Astro content collections.


Blog posts live in src/content/blog/. Each one is a Markdown file with a frontmatter block at the top.

Frontmatter

A minimal post looks like this:

---
title: "Post title here"
description: "A short summary."
pubDate: 2025-01-01
tags: ["optional", "tags"]
---

Post body goes here.

The title, pubDate, and description fields are used on the archive listing page. Tags are optional.

Filenames become URLs

The filename (without the .md extension) becomes the URL slug. A file named my-first-post.md will be available at /blog/my-first-post/ after build.

Drafts

Set draft: true in the frontmatter to hide a post from the listing and the homepage preview. Drafts are excluded from the build output entirely.

Sorting

Posts are sorted newest first by pubDate. Set dates in YYYY-MM-DD format.


← View All Blog Entries  |  ← Back to Profile