Freedom

Markdown Extras

·   5 min ·   Gautham Chettiar
Table Of Contents

These are some extras that have been added on top of default markdown syntax support. This enables quite a bit of handy features that is not available in vanilla Hugo.

Blockquotes #

A normal blockquote can be rendered using:

> This is a blockquote.

… which is rendered as:

This is a blockquote.

Apart from above vanilla style, blockquote supports below extras -

Blockquote Citation and Caption #

Extra options can be passed to blockquotes to add citations and captions:

> This is a blockquote with cite and captions.
{cite="https://gohugo.io" caption="Associated caption"}

… which is rendered as:

This is a blockquote with cite and captions.

[cite]
— Associated caption

 Note

You can configure default behavior for above blockquote citations and captions in your hugo.yaml:

hugo.yaml
params:
  showBlockquoteCite: true     ## Show citation links by default
  showBlockquoteCaption: true  ## Show captions by default

Alert-Style Blockquotes #

The style of blockquotes can be changed using alert syntax. Five alert types are supported: NOTE, TIP, IMPORTANT, WARNING, and CAUTION.

Static Alert #

> [!WARNING]
> Urgent info that needs immediate attention.

… which is rendered as:

 Warning

Urgent info that needs immediate attention.

Collapsible Alert (Expanded by Default) #

Use + to make the alert collapsible and expanded by default:

> [!WARNING]+
> Urgent info that needs immediate attention.

… which is rendered as:

 Warning

Urgent info that needs immediate attention.

Collapsible Alert (Collapsed by Default) #

Use - to make the alert collapsible and collapsed by default:

> [!TIP]-
> Click the arrow to expand this tip.

… which is rendered as:

 Tip

Click the arrow to expand this tip.

All Alert Types #

> [!NOTE]
> Useful information that users should know.

> [!TIP]
> Helpful advice for doing things better.

> [!IMPORTANT]
> Key information users need to know.

> [!WARNING]
> Urgent info that needs immediate attention.

> [!CAUTION]
> Advises about risks or negative outcomes.

… which is rendered as:

 Note

Useful information that users should know.

 Tip

Helpful advice for doing things better.

 Important

Key information users need to know.

 Warning

Urgent info that needs immediate attention.

 Caution

Advises about risks or negative outcomes.

Custom Alert Titles #

You can provide a custom title after the alert type and fold indicator. If no custom title is provided, the alert type (e.g., “Warning”, “Tip”) is used as the title.

> [!WARNING]+ Radiation hazard
> Do not approach or handle without protective gear.

> [!TIP]- Pro tip
> Always save your work frequently to avoid data loss.

> [!IMPORTANT] Critical update required
> Please upgrade to version 2.0 before January 1st.

… which is rendered as:

 Radiation hazard

Do not approach or handle without protective gear.

 Pro tip

Always save your work frequently to avoid data loss.

 Critical update required

Please upgrade to version 2.0 before January 1st.

Blockquote Width and Alignment #

Blockquotes support width and align attributes:

Example:

> [!NOTE]
> Useful information that users should know.
{width="compact", align="center"}

which is rendered as -

 Note

Useful information that users should know.

Codeblocks #

Standard code block with language syntax highlighting:

```go
package main

func main() {
    println("Hello, World!")
}
```

… which is rendered as:

go
package main

func main() {
    println("Hello, World!")
}

 Important

Hugo has a bunch of useful built-in configurations like

  • lineNos - used to display line numbers,
  • hl_Lines - used to highlight certain lines.

Refer hugo documentation for a complete list of supported options.

 Note

You can configure default behavior for all code blocks in your hugo.yaml:

yaml
params:
  showCodeblockLang: true  ## Show language labels by default
  showCodeblockCopy: true  ## Show copy buttons by default

This is used to configure whether to show/hide lang label and copy button discussed below globally.

Custom Display Label #

Use the display attribute to show a custom label (like a filename) instead of the language name:

```go {display="main.go"}
package main

func main() {
    println("Hello, World!")
}
```

… which is rendered as:

main.go
package main

func main() {
    println("Hello, World!")
}

Hide Language Label #

Use showLang=false to hide the language label:

```python {showLang=false}
def hello():
    print("Hello, World!")
```

… which is rendered as:

def hello():
    print("Hello, World!")

Hide Copy Button #

Use showCopy=false to hide the copy button:

```javascript {showCopy=false}
console.log("Hello, World!");
```

… which is rendered as:

javascript
console.log("Hello, World!");

Codeblock Width and Alignment #

Code blocks support width and align attributes:

Example:

```javascript {width="compact", align="center"}
console.log("Hello, World!");
```
javascript
console.log("Hello, World!");

Image #

A normal image can be rendered as -

![alt text](path/to/image.jpg)

… which is rendered as:

pexels-veeterzy-38136

Image with caption #

![alt text](path/to/image.jpg "Associated caption")

… which is rendered as:

pexels-veeterzy-38136
Associated caption

Image Pre-processing #

![pexels-veeterzy-38136](images/pexels-veeterzy-38136.jpg "Associated Caption")
{process="resize 350x|r90"}

… which is rendered as:

pexels-veeterzy-38136
Associated Caption

Refer Hugo | Image Processing for complete list of transformation options.

Image Width and Alignment #

Images support width and align attributes:

Example:

![pexels-veeterzy-38136](images/pexels-veeterzy-38136.jpg "Associated Caption")
{width="wide"}

… which is rendered as:

pexels-veeterzy-38136
Associated Caption

All external links are by default indicated with a and opens in a new tab, e.g: hugo.io.

 Note

Hugo doesn’t support attributes on markdown links. To customize link behavior per-link, use the link shortcode instead of markdown syntax.

You can configure default behavior for all links at global/kind/section/type level your hugo.yaml:

yaml
params:
  openExternalLinkInNewTab: true      ## Open external links in new tab by default
  showExternalLinkIndicator: true     ## Show external link indicator by default

or set the same in front-matter to set a default on per-page basis.

Tables #

Standard markdown tables can be created using pipe syntax:

| Header 1 | Header 2 | Header 3 |
| -------- | -------- | -------- |
| Cell 1   | Cell 2   | Cell 3   |
| Cell 4   | Cell 5   | Cell 6   |

… which is rendered as:

Header 1Header 2Header 3
Cell 1Cell 2Cell 3
Cell 4Cell 5Cell 6

Table Caption #

Add a caption to your table using the caption attribute:

| Product  | Price | Stock |
| -------- | ----- | ----- |
| Laptop   | $999  | 15    |
| Mouse    | $25   | 50    |
| Keyboard | $75   | 30    |
{caption="Table 1: Product inventory as of November 2025"}

… which is rendered as:

ProductPriceStock
Laptop$99915
Mouse$2550
Keyboard$7530
Table 1: Product inventory as of November 2025

Table Width and Alignment #

Tables support width, align, and caption attributes:

Example:

| Product  | Price | Stock |
| -------- | ----- | ----- |
| Laptop   | $999  | 15    |
| Mouse    | $25   | 50    |
| Keyboard | $75   | 30    |
{caption="Table 1: Product inventory as of November 2025", width="full"}

… which is rendered as:

ProductPriceStock
Laptop$99915
Mouse$2550
Keyboard$7530
Table 1: Product inventory as of November 2025