Markdown
Hugo supports Markdown syntax for formatting text, creating lists, and more. This page will show you some of the most common Markdown syntax examples.
Markdown Examples
Styling Text
| Style | Syntax | Example | Output |
|---|---|---|---|
| Bold | **bold text** | **bold text** | bold text |
| Italic | *italicized text* | *italicized text* | italicized text |
| Strikethrough | ~~strikethrough text~~ | ~~strikethrough text~~ | |
| Subscript | <sub></sub> | This is a <sub>subscript</sub> text | This is a subscript text |
| Superscript | <sup></sup> | This is a <sup>superscript</sup> text | This is a superscript text |
Blockquotes
Blockquote with attribution
Don’t communicate by sharing memory, share memory by communicating.
— Rob Pike1
> Don't communicate by sharing memory, share memory by communicating.<br>
> — <cite>Rob Pike[^1]</cite>
[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015.Alerts
Also known as callouts or admonitions, alerts are blockquotes used to emphasize critical information. Please make sure you are using the latest version of Hextra and Hugo v0.146.0 or later.
Basic syntax
Use [!TYPE] as the first line of the blockquote.
Note
Useful information that users should know, even when skimming content.
Tip
Helpful advice for doing things better or more easily.
Important
Key information users need to know to achieve their goal.
Warning
Urgent info that needs immediate user attention to avoid problems.
Caution
Advises about risks or negative outcomes of certain actions.
> [!NOTE]
> Useful information that users should know, even when skimming content.
> [!TIP]
> Helpful advice for doing things better or more easily.
> [!IMPORTANT]
> Key information users need to know to achieve their goal.
> [!WARNING]
> Urgent info that needs immediate user attention to avoid problems.
> [!CAUTION]
> Advises about risks or negative outcomes of certain actions.The basic syntax is compatible with GitHub, Obsidian, and Typora.
Extended syntax
Add + or - after the type to make the alert foldable, and add text after the marker to set a custom title. This syntax is compatible with Obsidian callouts only.
Yes. Foldable alerts hide their content when collapsed.
> [!TIP]- Are alerts foldable?
> Yes. Foldable alerts hide their content when collapsed.Tables
Tables aren’t part of the core Markdown spec, but Hugo supports them out-of-the-box.
| Name | Age |
|---|---|
| Bob | 27 |
| Alice | 23 |
| Name | Age |
| :---- | :-- |
| Bob | 27 |
| Alice | 23 |Inline Markdown within tables
| Italics | Bold | Code |
|---|---|---|
| italics | bold | code |
| Italics | Bold | Code |
| :-------- | :------- | :----- |
| _italics_ | **bold** | `code` |Code Blocks
Lists
Ordered List
- First item
- Second item
- Third item
1. First item
2. Second item
3. Third itemUnordered List
- List item
- Another item
- And another item
* List item
* Another item
* And another itemNested list
- Fruit
- Apple
- Orange
- Banana
- Dairy
- Milk
- Cheese
- Fruit
- Apple
- Orange
- Banana
- Dairy
- Milk
- CheeseTask list
- Write documentation
- Review code
- Deploy changes
- [x] Write documentation
- [ ] Review code
- [ ] Deploy changesImages
With caption:
For more advanced functionality, use Hugo’s built-in Figure shortcode.
Configuration
Hugo uses Goldmark for Markdown parsing.
Markdown rendering can be configured in hugo.yaml under markup.goldmark.
Below is the default configuration for Hextra:
markup:
goldmark:
renderer:
unsafe: true
highlight:
noClasses: falseFor more configuration options, see Hugo documentation on Configure Markup.