This post is a grab-bag of Markdown patterns you can use in Hugo. Copy sections as a starting point.
Headings
H1 Title (usually the page title)
H2 Section
H3 Subsection
H4 Detail
H5 Small
H6 Tiny
Text styles
Normal text, bold, italic, bold italic, strikethrough, and inline code.
You can also force a line break by ending a line with two spaces.
Like this.
Links
- External link: Hugo
- Internal link: About
- Auto link: https://example.com
Lists
Unordered list:
- Item one
- Item two
- Nested item
- Another nested item
- Item three
Ordered list:
- First step
- Second step
- Third step
Task list:
- Write the draft
- Add tags
- Publish
Blockquotes
A short quote can add emphasis.
You can also make multi-line quotes.
Horizontal rule
Images
Inline image:
Figure shortcode (Hugo):
Figure shortcode with caption
Tables
| Column | Type | Notes |
|---|---|---|
| title | string | Page title |
| date | time | Publish date |
| tags | array | Categories or labels |
Code blocks
hugo server -D
const posts = ["hello-world", "reading-log"];
const latest = posts.at(-1);
console.log(`Latest: ${latest}`);
def slugify(text: str) -> str:
return text.strip().lower().replace(" ", "-")
package main
import "fmt"
func main() {
fmt.Println("Hello, Hugo")
}
<article class="post">
<h1>Title</h1>
<p>Intro text.</p>
</article>
:root {
--accent: #e4572e;
}
.post a:hover {
color: var(--accent);
}
title = "My Hugo Site"
theme = "gokarna"
[params]
showPostsOnHomePage = "recent"
title: "Markdown Showcase"
tags:
- markdown
- examples
{
"title": "Markdown Showcase",
"tags": ["markdown", "examples"]
}
Footnotes
Here is a statement that needs a footnote.1
Inline HTML
Escaping characters
Use a backslash to escape: *not italic*, #not a heading.
This is the footnote text. ↩︎