How to publish a post
The frontmatter this blog expects, and the Markdown features available in a post.
A post is a folder under src/content/blog/ with an index.md inside. The
folder name is the URL: src/content/blog/how-to-publish-a-post/ is served at
/blog/how-to-publish-a-post/.
Frontmatter
title, description, date and authors are required; the build fails
without them. authors holds references to files in src/content/authors/, by
filename without the extension.
tags, image, draft and order are optional. image resolves against the
post’s own folder, so ./cover.png sits next to this file.
Note
Unlike Hugo, a future date still publishes. To hide a post, set
draft: true.
Code
Fenced blocks get syntax highlighting, a frame and a copy button:
export const greet = (name: string): string => `Hello, ${name}`Inline code can be highlighted too, with the `code{:lang}` annotation:
const x = 1.
Shell blocks drop the line numbers:
docker compose run --rm --no-deps buildCallouts
Five variants: note, tip, warning, caution and important. Add
{closed} to render one collapsed.
Tip
Callouts are <details> elements, so they are open by default and the reader
can fold them away.
Warning
This one starts collapsed.
Math
Inline math like , and display math:
It renders to native MathML through Temml, so there is no client-side layout step.
Images
