Hugo Content Cheat Sheet
This post is a living reference of every content feature available on knutlabs. Use it as a guide when writing new posts.
1. Markdown Basics
Headings
Use # for headings. Here are the levels available inside a post (H2–H4 are most common):
Heading 2
Heading 3
Heading 4
Text Formatting
| Syntax | Result |
|---|---|
**bold** |
bold |
*italic* |
italic |
~~strikethrough~~ |
|
`inline code` |
inline code |
You can also combine them: bold italic, bold strikethrough.
Unordered Lists
- First item
- Second item
- Nested item
- Another nested item
- Third item
Ordered Lists
- First step
- Second step
- Third step
- Sub-step A
- Sub-step B
Blockquotes
This is a blockquote. Use it to call out important quotes or to highlight a key idea from someone else’s work.
Blockquotes can also be nested:
Like this inner quote.
Horizontal Rule
Use --- to create a horizontal divider:
Links
Standard markdown links:
- External link — opens a URL
- Link with title — has hover text
Images
Standard markdown image syntax:

Tables
| Service | Port | Protocol |
|---|---|---|
| HTTP | 80 | TCP |
| HTTPS | 443 | TCP |
| DNS | 53 | UDP/TCP |
| SSH | 22 | TCP |
Tables support left, center, and right alignment:
| Left | Center | Right |
|---|---|---|
| A | B | C |
| 1 | 2 | 3 |
2. Code Blocks
Inline Code
Use backticks for inline code like variable names or commands.
Fenced Code Blocks
Use triple backticks with a language name for syntax highlighting:
#!/bin/bash
echo "Hello from knutlabs"
systemctl status nginx
def greet(name: str) -> str:
return f"Hello, {name}!"
print(greet("knutlabs"))
apiVersion: v1
kind: Service
metadata:
name: knutlabs-web
spec:
selector:
app: web
ports:
- port: 80
targetPort: 8080
package main
import "fmt"
func main() {
fmt.Println("hello world")
}
Syntax Highlighting Shortcode
Hugo’s built-in highlight shortcode gives you extra control like line numbers:
|
|
3. Code Dropdown
Use the custom code-dropdown shortcode to hide long code blocks behind a collapsible toggle:
4. Hint / Callout Blocks
Three severity levels to draw attention to important information:
Info
hugo server -D flag to include draft posts when running the local dev server.
Warning
Danger
5. Tabs
Use tabs when you want to show the same concept in multiple languages or contexts:
print("hello from Python")
fmt.Println("hello from Go")
echo "hello from Bash"
Another example — OS-specific install instructions:
sudo apt update
sudo apt install nginx
sudo yum install nginx
brew install nginx
6. Collapsible Sections (Details)
For content that’s useful but not essential — hide it behind a click:
Click to see the full error log
2026-02-14 10:32:01 ERROR [nginx] upstream timed out
(110: Connection timed out) while connecting to upstream
client: 192.168.1.50
server: app.knutlabs.com
request: "GET /api/health HTTP/1.1"
upstream: "http://127.0.0.1:3000/api/health"
Explanation of subnet masks
A subnet mask determines which portion of an IP address is the network part and which is the host part.
/24= 255.255.255.0 → 254 usable hosts/16= 255.255.0.0 → 65,534 usable hosts/8= 255.0.0.0 → 16,777,214 usable hosts
7. Buttons
Link buttons for calls to action:
Hugo Documentation Visit GitHub8. Download Button
Provide a file download link styled as a button. Place files in the static/ directory and reference them:
{{< download file="/files/example-config.yaml" name="Download example-config.yaml" >}}
Parameters:
| Parameter | Required | Description |
|---|---|---|
file |
yes | Path to the file (relative to static/) |
name |
no | Button label (defaults to the file path) |
9. Figure (Image with Caption)
The figure shortcode adds a caption below an image:
{{< figure src="/images/diagram.png" title="Network topology diagram" >}}
This renders an <img> inside a <figure> element with a <figcaption>.
10. Mermaid Diagrams
Render flowcharts, sequence diagrams, and more using Mermaid syntax:
Flowchart
Sequence Diagram
11. Math (LaTeX)
Render mathematical formulas with KaTeX. Use $$ for display (block) math and $ for inline math.
Display Math
$$ E = mc^2 $$
$$ \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} $$
Inline Math
The formula for bandwidth-delay product is $BDP = bandwidth \times RTT$, measured in bits.
12. Emoji
Hugo supports emoji when enableEmoji = true in the config. Use standard shortcodes:
- 🚀
:rocket: - ✅
:white_check_mark: - ⚠️
:warning: - 🔥
:fire: - 🔧
:wrench: - 📖
:book: - 🌐
:globe_with_meridians:
13. Front Matter Reference
Every post starts with YAML front matter between --- delimiters:
Available Fields
| Field | Type | Description |
|---|---|---|
title |
string | Post title (required) |
date |
date | Publication date for ordering |
draft |
bool | If true, only visible with -D flag |
labels |
list | Labels for filtering (e.g. Solution, Feature, RFC) |
summary |
string | Short description used in search and metadata |
Standard Labels
The following labels are used across knutlabs:
Solution · Feature · Test · Protocol · RFC · Automation · Migration · NOC · Security
Quick Reference
| Feature | Syntax |
|---|---|
| Code dropdown | {{< code-dropdown title="..." >}} ... {{< /code-dropdown >}} |
| Hint block | {{< hint info >}} ... {{< /hint >}} |
| Tabs | {{< tabs >}} {{< tab "Name" >}} ... {{< /tab >}} {{< /tabs >}} |
| Collapsible | {{< details "Title" >}} ... {{< /details >}} |
| Button | {{< button href="..." >}} Text {{< /button >}} |
| Download | {{< download file="/files/name.ext" name="Label" >}} |
| Mermaid | {{< mermaid >}} graph TD ... {{< /mermaid >}} |
| Figure | {{< figure src="..." title="..." >}} |
| Highlight | {{< highlight lang "opts" >}} ... {{< /highlight >}} |
| Math (block) | $$ formula $$ |
| Math (inline) | $ formula $ |
| Emoji | :rocket: → 🚀 |