Hugo static-site source for the DbGate documentation, published at dbgate.io. This repo contains no application code — only Markdown content, a small set of theme overrides, and site config. The visual theme (hugo-theme-relearn) is a git submodule, not vendored source.
- Hugo extended (currently builds with v0.140.x)
- Node.js and yarn
# first-time setup / after pulling — fetches the theme submodule
git submodule update --init --recursive
# install JS deps (pulls in @mdi/font icons and copies them into static/mdi via postinstall)
yarn install
# local dev server with live reload, served at http://localhost:1313
hugo server
# production build — output goes to public/
hugo --gc --minifyThere is no lint, test, or typecheck command in this repo — it's Markdown content plus Hugo templates.
content/<lang>/— all documentation pages, one Markdown file per page, one directory per language (content/en/is the English source; see Localization). The site home page (content/en/_index.md) is a product picker. Top-level entries are the products:dbgate/(the desktop/self-hosted app —getting-started/,working-with-data/,database-operations/,customization/,admin/,developer/categories plusdbgate-cloud.mdnested underneath), and the hosted productsdbgate-lite.md,dbgate-central/,dbgate-shopify-app.md. A section directory needs an_index.mdfor its landing page, and can nest further sections (e.g.dbgate/getting-started/installation/,dbgate-central/). Ordering within the left nav is controlled by theweightfront matter field (lower = earlier), not by filename or directory order. Pages moved between categories carry analiases:front matter entry pointing at their old URL, so existing links keep working. Aliases belong to English only and must never appear in a translated file — Hugo does not language-prefix them, so a copied alias silently steals the English redirect and the build still succeeds. See Localization.layouts/— thin overrides/additions on top of thehugo-theme-relearnsubmodule theme:layouts/partials/overrides theme partials (custom-header.html,favicon.html,logo.html).layouts/shortcodes/defines custom Hugo shortcodes used throughoutcontent/:{{< mdi "icon-name" >}}(Material Design Icons),{{< check >}}(checkmark, used in the database support matrix),{{< center >}}(centers content, e.g. table headers).
themes/hugo-theme-relearn/— git submodule; do not edit directly. Theme-level look-and-feel changes belong inassets/css/theme-dbgate.css(thedbgatetheme variant referenced bythemeVariantinhugo.toml) or in thelayouts/overrides above.hugo.toml— site config. Notable:markup.goldmark.renderer.unsafe = true(raw HTML in Markdown is allowed),sitemap.exclude = ["purchase"], theme variant isdbgate, and the[languages]block (see Localization).static/— files served as-is at the site root (favicon, screenshots referenced from content, MDI font files copied in by thepostinstallyarn script — don't hand-editstatic/mdi/).
Images referenced from content/<lang>/**/*.md are mostly hotlinked from https://media.dbgate.io/img/... rather than stored in this repo; a smaller set of local screenshots lives under static/img/ and static/screenshots/. Images are shared across languages — translations never rewrite image paths.
The site is multilingual, using Hugo's native translation-by-content-directory and the same conventions as the sibling ../web-dbgate-io repo. English is the source language; every other language is a machine translation of it.
- Languages — configured in the
[languages]block ofhugo.toml, each with its owncontentDir. Currently English (en) and Czech (cs). The remaining targets, with weights reserved to match web-dbgate-io, arede30,fr40,es50,sk60,zh70,pt80,it90,ja100,ko110. Add a language tohugo.tomlonly once its content is actually translated — a language with an emptycontentDirfalls back to English and publishes untranslated duplicates under its prefix. - URLs —
defaultContentLanguageInSubdir = false, so English stays at the root (/dbgate/...) and translations are prefixed (/cs/dbgate/...). Existing English URLs and inbound links are unaffected. - UI chrome — supplied by the
hugo-theme-relearnsubmodule, which ships translations for every configured language except Slovak. There is no project-leveli18n/directory; ifskis added, createi18n/sk.tomlseeded from the theme'si18n/en.toml(Hugo merges project i18n over theme i18n). The language switcher, per-language search index, andlangattribute are all automatic. - hreflang — emitted by
layouts/partials/custom-header.html(the theme emits none of its own).
Run the translation Claude Code skill (.claude/skills/translation/), which translates via local Claude subagents — no API key. It is incremental: each translated file stores a sourceHash of its English source, so unchanged pages are skipped and changed ones are patched paragraph-by-paragraph.
# what needs (re)translating — JSON work plan, deterministic, no network
python .claude/skills/translation/translate_plan.py [--lang cs] [--path working-with-data] [--type md]Then invoke the skill (e.g. /translation cs) to execute the plan. See .claude/skills/translation/SKILL.md for the full rules.
Two invariants matter when touching translations:
- Translations must never contain an
aliases:key. Aliases are legacy English URLs. Hugo only language-prefixes aliases onIsMultihostsites, which this is not — so a copied alias silently overrides the English redirect (e.g./maps/starts serving the Czech page) and the build still exits 0 with no warning. Guard:grep -rl "^aliases:" content/cs/must return nothing. - Root-relative internal links get the language prefix (
](/dbgate/x)→](/cs/dbgate/x)); relative links (](../foo/)) and image paths are left alone.
Two CI paths exist:
.github/workflows/azure-static-web-apps-ambitious-pebble-0eed14903.yml— active workflow, builds withyarn install && hugoand deploys to Azure Static Web Apps on push/PR tomaster..github/workflows/hugo.yaml.bak— disabled (.bak) GitHub Pages deployment workflow, kept for reference.
Both build against the submodule theme, so a PR that updates themes/hugo-theme-relearn must commit the new submodule commit pointer, and CI must check out with submodules enabled.