This post has no German counterpart. That is deliberate — it demonstrates the fallback: the language switcher sends a reader to the German blog index rather than a dead URL, and the post itself says so.
Writing a post
Create a file at src/content/blog/<locale>/<slug>.md. The frontmatter:
---
title: "The title, as displayed"
description: "One or two sentences. Used as the excerpt, the meta description,
and the RSS summary."
pubDate: 2026-03-01
updatedDate: 2026-03-04 # optional
tags: ["math", "optimization"]
translationKey: some-key # optional; links language variants
draft: false # optional; drafts are dev-only
comments: true # optional; false hides the widget
---
Or run pnpm new:post and answer the prompts.
Tags
Tags are stable keys, not prose. Write math, not Mathematik — the same tag in both
languages means a reader keeps their filter when switching language. Every tag used by
at least one post gets its own page automatically; there is no tag registry to update.
Mathematics
Inline maths uses single dollars, , and display maths uses double:
Rendering happens at build time via KaTeX. No JavaScript reaches the reader for it.
Code
Fenced blocks are highlighted at build time by Shiki, with separate light and dark themes that follow the site’s colour scheme:
export function readingTime(body: string): number {
const words = body.trim().split(/\s+/).filter(Boolean).length;
return Math.max(1, Math.round(words / 200));
}
Images
Put them in src/assets/ and reference them relatively to get Astro’s image
optimisation, or in public/img/ to have them served untouched.