2 min read
Blog Collection

The blog collections is found in src/content/blog.

Working with the blog collection:

πŸ“ /src/content/blog
└── πŸ“ post-1
      └── πŸ“„ index.md
└── πŸ“ post-2
      └── πŸ“„ index.mdx

In the above example, two static pages will be generated, based on the existence of a classic markdown .md file or a jsx compatible markdown .mdx file. The folder name represents the slug:

  • https://example.com/blog/post-1
  • https://example.com/blog/post-2

All content must be preceded by required metadata in the markdown file in yaml format, and be enclosed by triple dashes. --- ---

---
title: "My cool new title"
description: "A description of my content."
date: "Mar 22 2024"
draft: false
---

Metadata fields

FieldReqTypeRemarks
titleYesstringTitle of the content. Used in SEO and RSS.
descriptionYesstringDescription of the content. Used in SEO and RSS.
dateYesstringMust be a valid date string (able to be parsed).
draftNo*booleandraft: true, content will not be published.

All that’s left to do is write your content under the metadata.

---
title: "My cool new title"
description: "A description of my content."
date: "Mar 22 2024"
draft: false
---

### Woot

This is a paragraph.

πŸŽ‰ Congrats, you are now a blogger.