A minimal Hugo theme for personal blogs and technical writing, with readable code, multilingual pages, and light and dark modes.
Live demo · Features · Parameters · Full example configuration
| Light | Dark |
|---|---|
![]() |
![]() |
- Light, dark, and system-following color modes, with a manual switcher.
- Multilingual pages, language switching, and RSS feeds.
- Collapsible table of contents, syntax highlighting, code copying, Mermaid diagrams, and opt-in MathJax.
- Giscus, Disqus, and Utterances comments; Google Analytics and Umami integration.
- Mobile reading layouts: single-row scrollable navigation, responsive titles, and independently scrolling code blocks and wide tables.
- Figure captions, smaller muted footnotes, and subtle icons on article text links.
The mobile and article styling improvements are included in v1.9.0. See the release notes for changes and upgrade guidance.
Install Hugo and Git. The quick start and both example configurations have been verified with Hugo extended 0.167.0. This is a tested version, not a claimed minimum; older versions have not been validated as part of this update. The built-in styles use plain CSS. Additional Sass requirements are described below.
hugo new site my-blog
cd my-blog
git init
git submodule add https://github.com/hugo-theme-anubis2/hugo-theme-anubis2.git themes/anubis2For an existing Hugo site, run only the submodule command from the site root; initialize Git first if needed.
For a new site, replace the generated configuration with the minimal example:
cp themes/anubis2/example-site/hugo.minimal.toml hugo.tomlThe minimal configuration is:
baseURL = "https://example.org/"
locale = "en-us"
title = "My Blog"
theme = "anubis2"
[pagination]
pagerSize = 5
[params.author]
name = "Your Name"
[params.anubis2]
colortheme = "auto"
[markup.goldmark.renderer]
unsafe = true # Render raw HTML such as figures in Markdown.Set baseURL to your deployed site's address and replace the title and author. When adapting an existing site, merge the relevant settings instead of replacing your configuration.
hugo new content posts/hello-world.md
hugo server -DAdd Markdown below the front matter in content/posts/hello-world.md, then open localhost:1313. New posts are drafts; -D includes them in the preview. Set draft = false in TOML front matter (or draft: false in YAML) when the post is ready to publish, then run hugo to build the site into public/.
When cloning a site that already uses this theme, initialize its submodules before building:
git submodule update --init --recursiveTheme settings belong under params.anubis2. These docs use lowercase parameter keys consistently. Hugo normalizes keys in params, so existing camelCase settings such as colorTheme and repoId also work; they do not need a case-only migration.
For navigation, add menu entries to hugo.toml. A menu item links to a page; it does not create that page.
[[menu.main]]
name = "Home"
url = "/"
weight = 1
[[menu.main]]
name = "Archive"
url = "/posts/"
weight = 2Add social links to your existing [params.anubis2] table:
socialicons = [
{ id = "github", url = "https://github.com/your-name" },
{ id = "email", url = "mailto:you@example.org" }
]See PARAMS.md for defaults, per-page options, and service configuration. The full example also demonstrates language-specific menus. Its comments and analytics use demo accounts: replace those service tables with your own settings, or remove them.
Create assets/css/custom.css in your site and add the following to your existing [params.anubis2] table:
customcss = ["css/custom.css"]Paths are relative to assets/. Custom CSS loads after the theme styles, so you can override them without editing the theme submodule. For example, to remove the decorative article link icons:
article.post .content a[href]::after {
content: none !important;
}Plain CSS needs no Sass compiler. For custom .scss or .sass assets, install Dart Sass on both your development and build hosts, and add these settings to [params.anubis2]:
csstranspiler = "dartsass"
customcss = ["css/custom.scss"]The theme's compatibility default is libsass, which requires Hugo extended. Hugo deprecated LibSass in v0.153.0; use Dart Sass for new Sass customizations. The full example keeps its Sass demonstration commented out so it can build without an additional compiler.
From your site's root, update only this theme:
git submodule update --remote themes/anubis2
hugoReview the site locally with hugo server -D. Once satisfied, commit the updated theme reference so deployments use the same revision:
git add themes/anubis2
git commit -m "chore: update Anubis2 theme"This follows the submodule's configured branch, or the remote's default branch when none is configured. To keep builds reproducible, commit the reference rather than running --remote during every deployment.
- New post missing: preview with
hugo server -D, or setdraft = false(TOML) /draft: false(YAML) for publication. Future-dated posts need--buildFuturewhen previewing. - Theme not found after cloning: run
git submodule update --init --recursive. - Deprecated top-level theme parameters: move settings such as
params.colorThemeintoparams.anubis2. Consult PARAMS.md for renamed options; capitalization alone is not the migration issue. - LibSass warning: use plain CSS, or install Dart Sass and set
csstranspiler = "dartsass". - Raw HTML omitted: enable
[markup.goldmark.renderer] unsafe = trueif you want raw HTML in your Markdown, including HTML figures. Both example configurations enable this setting. - Math not rendered: set
math: truein the page front matter, or enableenablemathgloballyunderparams.anubis2. - Analytics absent in local preview: analytics are injected only in production builds. Use
hugo --environment productionto inspect that output.
Report bugs and feature requests in Issues, or open a pull request. For rendering issues, include your Hugo version, relevant configuration, and a small content example.
To preview the example site from a theme checkout, run the full example configuration (the minimal example also builds, with fewer features enabled):
hugo server --source example-site --config hugo.full.toml --themesDir ../.. --theme "$(basename "$PWD")" -DTo build instead of serving, use hugo in place of hugo server. To check the minimal configuration, replace hugo.full.toml with hugo.minimal.toml.
MIT © Junyi, 2024.


