Welcome to the Grow blog. This post is the reference template for editors. It’s written in Markdown (.md), which is the recommended format: it’s simple and doesn’t break on symbols like < or {.
How to create a new post
- Copy this file to
site/src/content/blog/my-slug.md. The filename is the slug (the URL will be/blog/my-slug/). - Replace the frontmatter with the new article’s data. All required fields are defined in
site/src/content.config.ts, and the build fails if any are missing. - Write the content below the closing three dashes of the frontmatter, in standard Markdown.
Frontmatter — fields
| Field | Required | Notes |
|---|---|---|
title | yes | Max 70 characters. |
description | yes | Max 160 (used in meta description and OG). |
pubDate | yes | YYYY-MM-DD. |
updatedDate | no | If the post was edited after publishing. |
author | yes | Full name or handle. |
tags | no | List of strings; defaults to empty. |
ogImage | no | Image relative to the file (e.g. ./my-slug.jpg); if omitted, the site’s share image is used. |
draft | no | true excludes it from the index and RSS. Defaults to false. |
Headings, lists, code
## headings render as sections. Code blocks work like this:
function greet(name: string) {
return `Hello, ${name}`;
}
Markdown vs MDX — when to use each
- Use
.md(this one) for 99% of posts. You can write free text without worrying about anything. .mdxonly if you need to import Astro components inside the article. Careful: in.mdx, the characters<and{are parsed as code, so writing something likecompanies with <500 employeesora {50%} discountbreaks the build with an MDX error. That doesn’t happen in.md.
Next steps
- Define editorial voice and style guidelines in
plans/editorial-guide.md(TODO). - (Optional) create a default brand OG image at
site/public/assets/blog/og-default.jpgand point to it inBlogPost.astro.