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.

Lists

Unordered list:

  • Item one
  • Item two
    • Nested item
    • Another nested item
  • Item three

Ordered list:

  1. First step
  2. Second step
  3. 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:

Avatar sample

Figure shortcode (Hugo):

Avatar sample

Figure shortcode with caption

Tables

ColumnTypeNotes
titlestringPage title
datetimePublish date
tagsarrayCategories 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.


  1. This is the footnote text. ↩︎