Guides
Example Post
· 3 min read
This is an example article body. It exists so the starter builds green out of
the box — output: export fails on any dynamic route whose
generateStaticParams() returns an empty array, so there must always be at
least one post. Delete it once the first real article is in.
How articles are wired up
Three files, every time:
- This file —
src/content/blog/<slug>.mdx, the body only. No frontmatter, no<h1>: the title comes from the metadata entry and is rendered by the page template, so putting one here would produce two<h1>s. src/content/blog.ts— the metadata entry (title, meta description, dates, category, read time). This is what the listing page and the sitemap read.src/content/blog/registry.tsx— imports this file and maps the slug to it. MDX can't be imported dynamically in a static export, so each body is registered explicitly.
What you get for free
Styling comes from src/components/mdx-components.tsx, so every element below
is themed without a single import in this file:
- Bulleted and numbered lists
- Bold and links
- Tables and block quotes
Pull quotes are styled too. Useful for the one line a client wants to stand out.
Headings here start at ## — see above.