Hugo theme used by the OpenCommit Foundation for its sites.
  • HTML 47.2%
  • CSS 42.8%
  • JavaScript 10%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Martijn van der Kleijn 6e320996d0
fix: correct url to news site in README
Signed-off-by: Martijn van der Kleijn <martijn@opencommit.eu>
2026-09-27 21:25:52 +02:00
archetypes feat: support plural authors taxonomy 2026-09-27 20:08:33 +02:00
assets initial commit 2026-08-06 00:03:36 +02:00
i18n initial commit 2026-08-06 00:03:36 +02:00
layouts fix: resolve footer RSS from the site home, not the current page 2026-09-27 21:21:59 +02:00
.gitignore chore: ignore .worktrees 2026-09-27 20:08:10 +02:00
go.mod initial commit 2026-08-06 00:03:36 +02:00
hugo.toml initial commit 2026-08-06 00:03:36 +02:00
README.md fix: correct url to news site in README 2026-09-27 21:25:52 +02:00
theme.toml initial commit 2026-08-06 00:03:36 +02:00

OpenCommit Hugo theme

A reusable Hugo theme in the look and feel of opencommit.eu (the Forgejo-based platform that gives open source a free home), maintained by the OpenCommit Foundation.

Powers news.opencommit.eu for example.

Features

  • OpenCommit colour palette, light & dark modes (follows system preference with a manual toggle)
  • Blog home, list, single-post, taxonomy, author and 404 layouts
  • Client-side search (JSON index) and related posts
  • Breadcrumbs, table of contents, share links, prev/next navigation, RSS feeds
  • SEO: meta description, Open Graph, Twitter cards, JSON-LD structured data
  • Configurable footer menu groups and header call-to-action
  • Posts section is configurable (postsSection) so the theme also works for news/sections with a different name

Requirements

  • Hugo extended, v0.163.0 or newer

    Language.Locale (0.158) and Page.IsBranch (0.163) replaced accessors that Hugo has since deprecated, so older versions are no longer supported.

Installation

The theme is published as a Hugo module, so the modern way to use it is via Go modules:

hugo mod init example.com/my-site
hugo mod get opencommit.eu/opencommit/oc-hugo-theme

Then add it to your site config:

[module]
  [[module.imports]]
    path = "opencommit.eu/opencommit/oc-hugo-theme"

The module resolves straight from the Forgejo repository (no Go proxy required). To pin a specific version, tag a release in the theme repo and run hugo mod get opencommit.eu/opencommit/oc-hugo-theme@v0.1.0. For reproducible builds, run hugo mod vendor and commit the _vendor/ directory.

To update: hugo mod get -u opencommit.eu/opencommit/oc-hugo-theme.

Classic install

Alternatively, clone the repository into your site's themes directory and add theme = "opencommit" to your site config:

git clone https://opencommit.eu/opencommit/oc-hugo-theme.git themes/opencommit

Quick start

baseURL = "https://example.org/"
languageCode = "en"
title = "My site"

[module]
  [[module.imports]]
    path = "opencommit.eu/opencommit/oc-hugo-theme"

# Enable the JSON home output used by the built-in search.
# (Theme defaults only guarantee HTML + RSS on the home page.)
[outputs]
  home = ["HTML", "RSS", "JSON"]

Configuration

All settings are optional; the theme ships sensible defaults.

Param Default Description
params.author "OpenCommit Foundation" Site-wide author name
params.description "" Site-wide meta description
params.tagline "Build. Push. Deploy." Shown next to the logo
params.logo "img/logo.svg" Logo asset inside the theme's assets directory
params.postsSection "posts" Section the home page and search index list
params.social.rss true Show RSS link in footer
params.social.forge "https://opencommit.eu" Forge link in footer
params.social.mail "" E-mail link in footer
params.social.mastodon "" Mastodon profile URL in footer
params.header.cta.label "Donate" Header call-to-action label
params.header.cta.url "" Header call-to-action URL (hidden when empty)
params.footer.about "" Footer "about" text
params.footer.note "EU non-profit · Open source" Small footer note
params.footer.groups three groups Footer link groups (title + menu name)

Menus

  • main: top navigation
  • footer_foundation, footer_platform, footer_legal: default footer groups (names are configurable via params.footer.groups)

External menu entries render an external-link marker. Set [menus.<menu>.params] target = "_blank" to open in a new tab, and noExternalMarker = true to hide the marker.

i18n

The theme ships en.toml. Add translations for the languages you publish in; add other locale files under i18n/ in your site or the theme.

Example

A working example site lives in the news repository at opencommit.eu/opencommit/news.opencommit.eu (it is built with this theme). To verify the theme locally, build a site with a few content files and run:

hugo server --themesDir ../.. --theme opencommit

When developing the theme against a local clone, point the module import at the local directory:

HUGO_MODULE_REPLACEMENTS="opencommit.eu/opencommit/oc-hugo-theme => /path/to/oc-hugo-theme" hugo server

assets/img/logo.svg is the official OpenCommit Foundation artwork. It is included for use with OpenCommit-related sites; treat it as property of the OpenCommit Foundation.

This theme is created and maintained by the OpenCommit Foundation. All code and images are copyrighted by the foundation.

The theme may be re-used under strict condition that it is not used to impersonate an official OpenCommit Foundation related site.