Hugo Configuration Guide (hugo.toml)#
A concise reference for the most useful configuration options in Hugo, especially for blog setups and themes like Terminal.
๐งญ Basic Site Configuration#
1
2
3
4
5
| baseURL = "https://yourusername.github.io/your-repo/"
languageCode = "en-us"
title = "My Blog"
theme = "terminal"
paginate = 5
|
Options#
baseURL โ Full URL of your deployed sitelanguageCode โ Default languagetitle โ Site titletheme โ Theme name (folder inside /themes)paginate โ Number of posts per page
๐ง Content Behavior#
1
2
| summaryLength = 30
enableRobotsTXT = true
|
summaryLength โ Number of words in summariesenableRobotsTXT โ Auto-generate robots.txt
๐ URLs & Structure#
1
2
| [permalinks]
posts = "/posts/:year/:month/:title/"
|
โ๏ธ Markdown & Code Highlighting#
Check Hugo doc for more details
1
2
3
4
5
6
7
| [markup]
[markup.highlight]
codeFences = true
guessSyntax = true
lineNos = false
style = "monokai"
noClasses = false
|
Highlight options#
codeFences โ Enable ``` blocksguessSyntax โ Auto-detect languagelineNos โ Show line numbersstyle โ Color themenoClasses โ Inline styles vs CSS classes
๐ Goldmark (Markdown engine)#
1
2
| [markup.goldmark.renderer]
unsafe = true
|
- Allows raw HTML inside Markdown
๐งฉ Params (Theme-specific)#
1
2
3
4
5
6
| [params]
contentTypeName = "posts"
themeColor = "orange"
showMenuItems = 2
fullWidthTheme = false
centerTheme = true
|
โ ๏ธ These depend on the theme. For Terminal:
contentTypeName โ Which folder is treated as poststhemeColor โ Accent colorshowMenuItems โ Items in navbarfullWidthTheme โ Stretch layoutcenterTheme โ Center content
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
| [languages]
[languages.en]
title = "My Blog"
[languages.en.menu]
[[languages.en.menu.main]]
identifier = "about"
name = "About"
url = "/about"
[[languages.en.menu.main]]
identifier = "posts"
name = "Posts"
url = "/posts"
|
Imaging#
Check Hugo doc
๐ผ Static Files#
Hugo automatically maps:
Example:
Becomes:
1
2
3
4
5
| [minify]
disableXML = true
[build]
writeStats = true
|
minify โ Compress outputwriteStats โ Useful for analyzing assets
1
2
3
| [taxonomies]
tag = "tags"
category = "categories"
|
Use in posts:
1
| tags: ["physics", "ml"]
|
๐ก Outputs#
1
2
| [outputs]
home = ["HTML", "RSS"]
|
- Enable RSS feeds or JSON output
๐งช Development vs Production#
Local preview:
Production build:
๐ง Best Practices#
- Always set
draft = false before publishing - Use page bundles for posts with images
- Avoid hardcoding
/your-repo/ in Markdown โ use relative paths - Keep
baseURL correct for GitHub Pages
๐ Example Minimal Config#
1
2
3
4
5
6
7
8
9
| baseURL = "https://yourusername.github.io/your-repo/"
languageCode = "en-us"
title = "My Blog"
theme = "terminal"
[markup]
[markup.highlight]
codeFences = true
guessSyntax = true
|
โจ Advanced (Optional)#
1
2
3
| [params]
customCSS = ["css/custom.css"]
customJS = ["js/custom.js"]
|
- Add custom styles or scripts
๐งญ Final Note#
Hugoโs power comes from:
- Markdown + configuration
- Templates (themes)
- Static asset pipeline
Most behavior is controlled either by:
hugo.toml- Theme
params - Layout overrides
Happy writing โจ