Writing Content

Writing in Markdown

Front matter, formatting and components for articles synced from GitHub or imported as a Markdown file.

Articles from a GitHub repository or an imported Markdown file are written in Markdown, a plain-text format where **bold** means bold.

Everything a Google Doc can do works here too, with tags in place of parentheses for components.

For a small, real example, see our demo repository: github.com/kytokev/seo-playbook .

Front matter

The article's details go in a block at the very top of the file, between two --- lines:

markdown
---
title: Keyword Research
description: Find the words your customers type into Google.
coverImage: ./images/cover.png
tags: [seo, keywords]
authors:
  - Ada Lovelace <ada@example.com>
---
FieldAlso acceptedWhat it sets
titlenoneThe title, and the article's address
descriptionsummary, excerptThe short summary under the title and in search results
coverImagecover, image, thumbnailThe image in listings and link previews
tagskeywordsTags: a list, or names separated by commas
authorsauthorAuthors, one per entry. The email is optional
  • Without title, a single # heading at the top becomes the title, and after that the file name.
  • Don't repeat the title as a # heading. A single top-level # heading is always removed from the article. Start sections at ##.
  • In a GitHub repository, coverImage can be a path inside the repo. For an imported file, use a full https:// address.

See Article Details for what each detail does on the site.

Formatting

Standard GitHub Markdown works:

WriteGet
## Heading to ###### HeadingHeadings. The highest level you use becomes the top level
**bold**, *italic*, ~~strikethrough~~Bold, italic, strikethrough
A word between backticksInline code
[text](https://example.com)A link
- item, 1. itemLists. Indent an item to nest it
> quoteA blockquote
A table with a --- line under the first rowA table. The first row is the header
--- on its own lineA divider
![alt text](image.png)An image

Two formats need a small HTML tag:

WriteGet
<u>underlined</u>Underline
<mark>highlighted</mark>Highlight

Code goes in a fenced block: a line of three backticks with the language after them, the code, then a line of three backticks.

The language turns on syntax highlighting, and the site draws it like this:

python
print("Hello")

These show as typed, or not at all:

  • Task-list checkboxes: - [ ] shows as a plain list item.
  • ==highlight==, footnotes and math show as typed.
  • Any other HTML tag, such as <div>, <details>, <sup> or <iframe>, is removed together with everything inside it.

Components

Write each component as a tag, with the opening and closing tags on lines of their own:

markdown
<Callout type="warning">
Back up your data **before** upgrading.
</Callout>

<Accordion heading="Can I use my own domain?">
Yes, on the Pro and Ultimate plans.
</Accordion>

<Image src="./images/home.png" alt="The dashboard home screen" caption="The dashboard after first sign-in" />

The text between the tags is normal Markdown: lists, bold, links and images all work inside.

ComponentTag
Callout<Callout type="info"> … </Callout>. type is info, warning, error or success
Accordion<Accordion heading="…"> … </Accordion>. Add open to start it expanded
Image<Image src="…" alt="…" caption="…" />. Add frame for a border, zoom="false" to turn off click-to-zoom
Code BlockA fenced code block with a language
BlockquoteA line starting with >
Divider--- on its own line
Description, Tags, Authors, Cover ImageFront matter. The tags also work, but front matter wins when both are set

Rules:

  • Use the exact capitalization: <Callout>, not <callout>. A lowercase tag is removed together with everything inside it.
  • Switches are written bare, with no value: <Accordion heading="…" open>, <Image … frame />.
  • Captions need the <Image> tag. The title in ![alt](src "title") is not shown.
  • For a one-paragraph component, the Google Docs short form works too: (Callout | type: info) Remember to save. at the start of a paragraph.

See Components for what each one draws, and the Kitchen Sink to see them rendered.

GitHub specifics

Images

Relative paths work: ![A search result](./images/search-result.png).

Contito copies the image to your site on sync.

Links to other files

Link to another Markdown file in the repository by its relative path, and the link points at that article on your site.

[Writing for Search](./content-strategy/01-writing-for-search.md) works, and so does ../ to go up a folder.

See Links Between Articles .

.mdx files

Contito reads .mdx files as Markdown.

Imports and code expressions are not supported: only the components above work.

File names and order

Name files for sorting, such as 01-introduction.md and 02-setup.md, and put the real title in front matter.

The articles appear in file-name order, and each gets its address from its title.

A full example

02-on-page-basics.md from the demo repository, as it appears on GitHub:

markdown
---
title: On-Page Basics
description: Titles, headings and descriptions that help Google understand a page.
tags: [seo]
---

## The title

Put the main keyword near the start. Keep it under 60 characters.

## Headings

Use one heading per idea, in order. Google reads them like a table of contents.

![A search result showing the title, address and description](./images/search-result.png)

<Callout type="warning">
Never stuff the same keyword into every heading. Google treats it as spam.
</Callout>

Next: [Writing for Search](./content-strategy/01-writing-for-search.md).