blog/writing

Markdown formatting reference

Every Markdown feature this site supports, with the rendered result next to the source, so writers can copy what they need.

//2 min read/updated


This page lists the formatting that the site renders. Keep it open in a second tab while you write. It is updated when the theme changes.

Headings

Start a post body at level two. Level one belongs to the post title, and the page would have two level-one headings if you used it again.

## A section
### A subsection

Use *text* for emphasis and **text** for strong emphasis. Write internal links as site paths, for example the tag index, so they keep working if the domain changes.

External links open in the same tab. Say where a link goes in the sentence itself, because a link that reads “click here” tells a screen reader nothing.

Lists

An unordered list:

  • First item.
  • Second item, which can run over more than one line if the following lines are indented by two spaces.
  • Third item.

An ordered list:

  1. Open the editor.
  2. Write the post.
  3. Save the file.

Quotations

A quotation carries the words of somebody else. Name the source in the sentence before it or straight after it.

Code

Inline code uses single backticks, for example npm run build. A code block uses three backticks and a language name:

export function readingTime(body: string): number {
  const words = body.trim().split(/\s+/u).length;
  return Math.max(1, Math.round(words / 200));
}

The block below has no language, so it renders as plain text:

GET /rss.xml
200 OK

Tables

Field Required Notes
title Yes Up to 120 characters.
description Yes Between 20 and 300 characters.
publishDate Yes The date the post goes public.
updatedDate No Never earlier than publishDate.
tags No Lowercase words joined by dashes.

Wide tables scroll sideways on a small screen. Keep the first column short so the reader can still see it while scrolling.

Images

![A short description of the picture](/src/assets/uploads/example.jpg)

Use the same path form in the frontmatter and in the body. The editor inserts it for you when you upload a file. The build resizes the image, converts it, and writes the width and height into the page.

Horizontal rules and line breaks

Use --- on its own line for a horizontal rule. Avoid manual line breaks inside a paragraph. The theme handles the wrapping.

What to avoid

Do not paste raw HTML into a post. The theme cannot style it, and it makes the post harder to move to another system later. Ask for a new component instead if the Markdown syntax cannot express what you need.

Related

all posts
Writing a summary that works#writingauthor-one / The summary field appears in listings, in search results, and in social previews. Here is how to write one that earns a click.