The Mono theme uses Chroma, Hugo’s built-in syntax highlighter, which supports hundreds of languages. The syntax color themes were generated using Hugo’s CLI:

bash
# Light theme (GitHub style)
hugo gen chromastyles --style=github > assets/css/syntax-light.css

# Dark theme (Catppuccin Mocha style)
hugo gen chromastyles --style=catppuccin-mocha > assets/css/syntax-dark.css

These are combined in assets/css/syntax.css and automatically switch based on the site’s light/dark mode.

To use a different theme, run the command with a different --style value (see Chroma styles for options).


Inline Code

For short code within a paragraph, use backticks:

Here is an example of inline code within regular text.

Written as:

markdown
Here is an example of `inline code` within regular text.

Code Blocks

For larger blocks of code, wrap with triple backticks and specify the language.

markdown
```python
def hello():
    print("Hello, World!")
```

Note that all code blocks include a copy button that appears on hover for easy copying.

In the following, we show examples for several languages and the resulting highlighted code blocks.

Python:

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

JavaScript:

javascript
function greet(name) {
    console.log("Hello, " + name);
}

Go:

go
package main

import "fmt"

func main() {
    fmt.Println("Hello, World!")
}

Rust:

rust
fn main() {
    println!("Hello, World!");
}

CSS:

css
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

HTML:

html
<!DOCTYPE html>
<html>
<head>
    <title>Hello</title>
</head>
<body>
    <h1>Hello, World!</h1>
</body>
</html>

Bash:

bash
#!/bin/bash
echo "Hello, World!"

SQL:

sql
SELECT name, email FROM users WHERE active = true;

Advanced Features

Line Numbers: Add {lineNos=table} after the language:

python
1
2
3
def hello():
    print("Hello")
    return True

Written as:

markdown
```python {lineNos=table}
def hello():
    print("Hello")
    return True
```

Line Highlighting: Highlight specific lines with hl_lines=[line_numbers_comma_separated]:

python
1
2
3
4
5
def example():
    # This line is highlighted
    x = 1
    # This line is also highlighted
    return x

Written as:

markdown
```python {lineNos=table,hl_lines=[2,4]}
def example():
    # This line is highlighted
    x = 1
    # This line is also highlighted
    return x
```

Diff Highlighting: Show code changes using diff syntax:

diff
- old_value = "remove"
+ new_value = "add"
  unchanged = "same"