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:
| Field | Also accepted | What it sets |
|---|---|---|
title | none | The title, and the article's address |
description | summary, excerpt | The short summary under the title and in search results |
coverImage | cover, image, thumbnail | The image in listings and link previews |
tags | keywords | Tags: a list, or names separated by commas |
authors | author | Authors, 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,
coverImagecan be a path inside the repo. For an imported file, use a fullhttps://address.
See Article Details for what each detail does on the site.
Formatting
Standard GitHub Markdown works:
| Write | Get |
|---|---|
## Heading to ###### Heading | Headings. The highest level you use becomes the top level |
**bold**, *italic*, ~~strikethrough~~ | Bold, italic, strikethrough |
| A word between backticks | Inline code |
[text](https://example.com) | A link |
- item, 1. item | Lists. Indent an item to nest it |
> quote | A blockquote |
A table with a --- line under the first row | A table. The first row is the header |
--- on its own line | A divider |
 | An image |
Two formats need a small HTML tag:
| Write | Get |
|---|---|
<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:
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:
The text between the tags is normal Markdown: lists, bold, links and images all work inside.
| Component | Tag |
|---|---|
| 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 Block | A fenced code block with a language |
| Blockquote | A line starting with > |
| Divider | --- on its own line |
| Description, Tags, Authors, Cover Image | Front 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 inis 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: .
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:
Related
- GitHub : connect a repository.
- Importing a Markdown File
- Components