Recipe: Add a blog post
Recipe: Add a blog post
- Create
content/blog/your-slug.mdx— the filename (minus.mdx) is the URL slug (/blog/your-slug). - Add frontmatter:
--- title: "Your post title" description: "One sentence — becomes the meta description and OG description." date: "2026-08-26" tags: ["nextjs"] # optional, first tag shows on the index card published: true # optional, omit or set false to keep it a draft --- - Write the body in Markdown/MDX below the frontmatter — standard
Markdown plus GFM tables/strikethrough (
remark-gfm) and fenced code blocks get Shiki syntax highlighting automatically (```ts→ highlighted TypeScript). - Verify:
npm run dev, visit/blog— the new post appears (newestdatefirst), and/blog/your-slugrenders with headings, code blocks, and the JSON-LDArticlescript in the page source. Settingpublished: falseremoves it from both the index and the sitemap while still being reachable if you know the direct URL — remove the flag (or delete the file) to unpublish for real. npm run build— the post's route shows up as a prerendered (●) static page, alongside the others, and/sitemap.xmlincludes its URL.