Configuration


Every setting Beautiful Hugo supports

This page is a complete reference for every configuration option in Beautiful Hugo. All settings go in your site’s hugo.toml (or config.toml/config.yaml).

Core Settings

ParamTypeDefaultDescription
homeTitlestringsite titleBrand name shown in the navbar, home page header, and footer link. Falls back to the site title when unset
subtitlestring""Site subtitle shown under the home page title
mainSectionslist["post", "posts"]Content sections treated as “posts” on the home page and archive page
logostringPath to a square avatar/logo image. When the file is found via Hugo’s asset pipeline (resources.Get), it is automatically processed into WebP format (300×300, quality 100) for optimal loading. If the file is not found as a resource, the raw path is used as-is.
faviconstringPath to favicon
dateFormatstringi18n defaultDate format string. Accepts Hugo locale tokens (e.g. ":date_long", ":date_medium", ":date_short") for automatic localization, or a Go time layout string based on the reference time Mon Jan 2 15:04:05 MST 2006 (e.g. "January 2, 2006" or "2006-01-02"). Do not use an example date like "2023-10-15" — the year must be 2006, month 01, and day 02. Locale tokens are recommended for multilingual sites. The theme validates dateFormat at build time and will emit a build error if it detects an invalid format (e.g. a date that doesn’t use Go’s reference time).
sinceintStart year for copyright range (e.g. 2015 - 2026)
[Params]
  subtitle = "Build a beautiful and simple website in minutes"
  mainSections = ["post", "posts"]
  logo = "/img/avatar-icon.png"
  favicon = "/img/favicon.ico"
  dateFormat = ":date_long"
  since = 2015

Math Engine

ParamTypeDefaultDescription
mathEnginestring"katex""katex", "mathjax", or "none"
  • "katex" — Loads KaTeX (CSS + JS) for math rendering. This is the current behavior and the default for backward compatibility.
  • "mathjax" — Loads MathJax 3 from CDN instead of KaTeX. MathJax is always loaded from CDN regardless of selfHosted since it is much larger than KaTeX.
  • "none" — Disables math rendering entirely; no math assets are loaded.
[Params]
  mathEngine = "mathjax"

Author

[Params.author] is required. The old top-level [author] key is deprecated and will produce a build error.

ParamTypeDescription
namestringAuthor display name (used in meta, copyright, post meta)
websitestringAuthor website URL (linked from copyright)
emailstringEmail (mailto: link in footer)

You can also add any social platform key here — see Comments & Social for the full list of 42 platforms.

[Params.author]
  name = "Some Person"
  website = "yourwebsite.com"
  email = "youremail@domain.com"
  github = "username"
  twitter = "username"

If a social value starts with http:// or https://, it is used as-is. Otherwise it is interpolated into the platform’s default URL pattern.

Color Scheme

ParamTypeDefaultDescription
colorSchemestring"auto""auto", "dark", or "light"

How it works

The theme uses the data-theme attribute on <html> to control dark mode:

  • "auto" — Follows the system preference (prefers-color-scheme). A toggle button appears in the navbar so users can override it. The toggle cycles through auto → light → dark → auto.
  • "dark" — Always dark. No toggle button is shown.
  • "light" — Always light. No toggle button is shown; dark CSS is not loaded at all.

When colorScheme = "auto", the theme reacts to OS-level dark mode changes in real time via a matchMedia listener. If a user changes their system appearance while the site is open, the page updates immediately (unless they have explicitly chosen light or dark via the toggle).

The user’s toggle preference persists across pages via localStorage (key: theme). An inline script in <head> restores it before the first paint to prevent a flash of the wrong theme.

For customizing dark mode colors, theme-dependent content, and other appearance overrides, see Theming.

selfHosted assets

When selfHosted = true, the following assets are served from static/ instead of CDNs:

AssetCDN SourceLocal Path
Bootstrap 5.3.5 CSScdn.jsdelivr.netcss/bootstrap.min.css
Font Awesome 7use.fontawesome.comfontawesome/css/*.min.css
KaTeX CSScdn.jsdelivr.netcss/katex.min.css
KaTeX JScdn.jsdelivr.netjs/katex.min.js + js/auto-render.min.js
Google Fonts (Lora, Open Sans)fonts.googleapis.comcss/fonts.css + fonts/
jQuery 4.0.0code.jquery.comjs/jquery-4.0.0.slim.min.js
Bootstrap 5.3.5 JScdn.jsdelivr.netjs/bootstrap.min.js
KaTeX JScdn.jsdelivr.netjs/katex.min.js + js/auto-render.min.js
Highlight.jscdn.jsdelivr.netjs/highlight.min.js + css/highlight*.min.css
PhotoSwipe 5.4.4cdn.jsdelivr.netjs/photoswipe*.min.js + css/photoswipe.css
[Params]
  colorScheme = "auto"
  selfHosted = false

Content Display

ParamTypeDefaultDescription
readingTimeboolfalseShow reading time in post meta
wordCountboolfalseShow word count in post meta
hideAuthorboolfalseHide author from post meta
socialShareboolfalseEnable social sharing buttons on posts
showRelatedPostsboolfalseShow related posts (by tag intersection)
related_content_limitint5Max number of related posts to display
rssboolfalseShow RSS icon in footer
disableFigureOverrideboolfalseWhen true, use Hugo’s native <figure> shortcode; beautifulfigure remains available
navShortboolfalseMake navbar permanently short (collapsed style)
showPageDatesboolfalseShow dates on “page” type pages
tocbooltrueShow a floating table-of-contents button on pages with headings
showSourceboolfalseShow a “View source” button linking to the page’s source file in the repository
showPostNavbooltrueShow previous/next post navigation (side arrows on wide screens, bottom pager on narrow screens)
sourceRepostringBase URL for the repository source browser (e.g. https://github.com/user/repo/blob/main/). The page’s .File.Path is appended automatically. When enableGitInfo = true is set, the branch in the URL is replaced with the current commit hash, so the link always points to the exact version of the file
[Params]
  readingTime = true
  wordCount = true
  socialShare = true
  showRelatedPosts = true
  disableFigureOverride = true
  showSource = true
  showPostNav = true
  sourceRepo = "https://github.com/user/repo/blob/main/"

Table of Contents Panel

When toc = true (the default), a list-style button appears in the navbar on pages that have headings or list pages that have posts. Clicking it opens a slide-out panel on the left side of the viewport.

On single pages (posts, regular pages), the panel shows the page’s heading hierarchy extracted from the Table of Contents. An IntersectionObserver tracks which heading is currently in view and highlights the corresponding link in the panel.

On list and home pages, the panel shows a list of post titles instead of headings. Scrolling through the post previews automatically highlights the currently visible post in the panel.

The panel can be closed by clicking the close button, clicking the backdrop overlay, or pressing Escape.

Big Image Header

Add one or more full-width header images to the home page. Multiple images cycle automatically with a fade transition.

[[Params.bigimg]]
  src = "/img/triangle.jpg"
  desc = "Triangle"
[[Params.bigimg]]
  src = "/img/sphere.jpg"
  desc = "Sphere"
  position = "center top"
[[Params.bigimg]]
  src = "/img/hexagon.jpg"
  desc = "Hexagon"
KeyTypeDefaultDescription
srcstringImage path (absolute or relative)
descstringImage description (supports Markdown links)
positionstringCSS background-position value (e.g. "center top")

| headerImgStyle | string | "big" | Header image height: "big" (default, 100–150px padding) or "narrow" (25px padding, crops image top and bottom) |

[Params]
  headerImgStyle = "narrow"

See Pages & Layouts for per-page big image headers and visual examples.

Syntax Highlighting

ParamTypeDefaultDescription
useHLJSboolfalseUse client-side Highlight.js instead of Hugo’s built-in Chroma
[markup.highlight]
  noClasses = false

[markup.goldmark.parser.attribute]
  block = true
  • noClasses = false is required for Chroma to use an external CSS file (static/css/syntax.css)
[Params]
  useHLJS = true

[markup.highlight]
  codeFences = false

When useHLJS = true, Highlight.js is loaded from CDN (or static/js/highlight.min.js if selfHosted = true) with a default light theme and a dark theme that activates automatically. You do not need Chroma code fences — Highlight.js applies styles via JavaScript.

See Code Blocks for details and examples.

Including External Files

The include-code shortcode reads a source file from disk and renders it with syntax highlighting. See Code Blocks for the full parameter reference and live examples.

Comment Systems

Beautiful Hugo supports five comment systems (Disqus, Giscus, Utterances, Cusdis, Staticman). Each is enabled per-page with comments: true in front matter. See Comments & Social for configuration details.

Google Analytics, Piwik/Matomo, and search (GCSE or built-in Fuse) are covered in SEO & i18n.

SEO Robot Meta Tags

Site-wide <meta name="robots"> tags can be set from hugo.toml. These settings only apply to pages in mainSections; other pages can set tags via front matter.

See SEO & i18n for the full reference including per-page overrides, AI summary limits, and all supported tags.

Custom HTML Hooks

Beautiful Hugo provides partial “hooks” that let you inject custom HTML at specific points in the layout without forking the theme. To use a hook, create the corresponding file in your site’s layouts/partials/ directory — the theme’s own copy is an empty stub.

PartialInjects NearExample Use
head_custom.htmlEnd of <head>, before </head>Extra CSS, preconnect hints, meta tags
nav_custom.htmlInside the navbar, after menu itemsCTA button, search box, custom nav link
header_custom.htmlInside the page header, after title/subtitleHero CTA button, banner
before_content.htmlBefore .Content on single pagesAffiliate disclosure, reading-time banner
after_content.htmlAfter .Content, before tags/share/relatedNewsletter signup, author bio, ad unit
footer_custom.htmlAfter </footer>, before scriptsCustom analytics, chat widget
scripts_custom.htmlAfter all theme JS, before </body>Custom JS that depends on jQuery/Bootstrap

See Theming for details on using these hooks for CSS and script customization.

Miscellaneous

ParamTypeDescription
disclaimerTextstringDisclaimer text shown in footer with a yellow-bordered box
commitstringBase URL for Git commit links (appended with .GitInfo.Hash)

Git features (commit) require enableGitInfo = true at the top level of your config (not under [Params]) so Hugo populates .GitInfo. Example:

commit = "https://github.com/user/repo/commit/"

Per-Page Front Matter

These options can be set in the front matter of any page or post:

ParamTypeDescription
subtitlestringPage/post subtitle
bigimglistPer-page big header images (same format as site-level)
headerImgStylestringHeader image height: "big" or "narrow"
fullWidthboolFull-width content layout (no sidebar offset)
socialShareboolOverride site-level social sharing for this page
showAvatarboolShow/hide navbar avatar (default: true)
commentsboolEnable comments on this page
hiddenboolHide from list pages
imagestringPost preview image (circular, shown in list pages)
videostringPost preview video (loop, autoplay, muted)
summarystringCustom summary text
descriptionstringPage description for meta tags and structured data (see SEO & i18n — Description Cascade)
typestringContent type that determines template behavior: "page", "post", or "recipe" (see Pages & Layouts)
authorstring/listPer-page author(s) (string or list of strings; supports Markdown links, e.g. "[Jane Doe](https://example.com)")
tagslistTags for categorization
categorieslistCategories for grouping posts
share_imgstringSocial sharing image (falls back to image then logo)
ExpiryDatedateAdds <meta name="robots" content="unavailable_after: ...">
seomapPer-page robot meta tag overrides (see SEO & i18n)
ghRepostringGitHub repo for buttons ("user/repo")
ghBadgelistWhich badges to show: ["star","watch","fork","follow"]
ghCountboolShow count on GitHub buttons (default: true)
showPageDatesboolShow dates on page-type pages
navShortboolMake navbar short on this page
tocboolShow/hide table of contents for this page (overrides site-level toc)
showSourceboolOverride site-level showSource for this page
showPostNavboolOverride site-level showPostNav for this page
mathEnginestringOverride site-level mathEngine for this page ("katex", "mathjax", or "none")
colorSchemestringOverride site-level colorScheme for this page ("auto", "dark", or "light")
useHLJSboolOverride site-level useHLJS for this page
readingTimeboolOverride site-level readingTime for this page
wordCountboolOverride site-level wordCount for this page
hideAuthorboolOverride site-level hideAuthor for this page
showRelatedPostsboolOverride site-level showRelatedPosts for this page
related_content_limitintOverride site-level related_content_limit for this page

Recipe Pages

Beautiful Hugo supports recipe content with automatic schema.org/Recipe structured data (JSON-LD) and a rendered recipe card below the page body. This provides SEO benefits — search engines can display rich recipe results with cook times, ingredients, and more.

Setup

Create content files with type: recipe and a recipe front matter map:

---
title: "Classic Chocolate Chip Cookies"
type: recipe
date: 2026-05-12
tags: ["baking", "dessert"]
recipe:
  prepTime: "PT15M"
  cookTime: "PT12M"
  totalTime: "PT27M"
  yield: "24 cookies"
  category: "Dessert"
  cuisine: "American"
  calories: "180 kcal"
  ingredients:
    - "2¼ cups all-purpose flour"
    - "1 tsp baking soda"
    - "1 cup unsalted butter, softened"
  instructions:
    - name: "Preheat oven"
      text: "Preheat oven to 375°F."
    - name: "Mix"
      text: "Combine flour, baking soda, and salt."
---

Recipe front matter reference

KeyTypeRequiredDescription
recipe.ingredientslistyesList of ingredient strings (supports Markdown)
recipe.instructionslistyesList of step strings or maps with name and text keys
recipe.prepTimestringnoISO 8601 duration (e.g. "PT15M" = 15 minutes)
recipe.cookTimestringnoISO 8601 duration
recipe.totalTimestringnoISO 8601 duration
recipe.yieldstringnoRecipe yield (e.g. "4 servings", "24 cookies")
recipe.categorystringnoRecipe category (e.g. "Dessert", "Main Course")
recipe.cuisinestringnoCuisine type (e.g. "Italian", "Japanese")
recipe.caloriesstringnoCalories per serving (e.g. "250 kcal")

How it works

  • Structured data: Pages with type: recipe and a recipe param emit a combined Article + Recipe JSON-LD block (as recommended by Google for recipe blog posts). Other pages continue to emit the standard Article schema.
  • Visual rendering: A recipe card is automatically rendered below the page body content, displaying metadata (prep time, cook time, yield, etc.), an ingredients list, and numbered instructions.
  • Archetype: Use hugo new recipe/my-recipe.md to get a pre-filled recipe front matter scaffold.
  • Page behavior: Recipe pages behave like blog posts (showing post meta, post navigation, and comments) since they are not type: page.

ISO 8601 duration format

Time values use the ISO 8601 duration format:

ExampleMeaning
PT15M15 minutes
PT1H30M1 hour 30 minutes
PT2H2 hours

P marks the start, T separates date from time components, and H/M/S are hours, minutes, seconds.