How to add posts

Frontmatter fields, the AI switches per post, drafts, tags and where images go.

1 min readguide

Posts live in src/content/blog/ as .md or .mdx files. The file name is the URL.

Frontmatter

---
title: How to add posts
description: One or two sentences, under 200 characters. Used in lists, meta tags and by the AI features.
date: 2026-11-08
updated: 2026-11-09
tags: [guide]
draft: false
ai:
  tldr: true
  askAuthor: true
  translate: true
  quiz: false
  readNext: true
---

Only title, description and date are required. draft: true hides a post from the build but keeps it in astro dev.

The ai block

Every post gets the AI buttons by default. Turn one off per post when it does not fit: a short announcement does not need a TL;DR, and a post that is already a translation should not offer Translate. quiz is off by default; turn it on for tutorials and the post ends with three questions written from its own content.

Images

Put images next to the post or in src/assets/. Reference them with a relative path and give them alt text. If you forget, npm run ai:alt writes alt text for every image that has none and shows you the diff before saving.

Missing descriptions and tags

npm run ai:meta reads every post that has no description or no tags, proposes them from the body, and writes them into the frontmatter. It runs on your machine with your key and caches results, so it never costs tokens twice for the same text.

Read next

Three posts that follow on from this one, picked from the whole blog with a reason each.