adaptif.de – Produkt-Landingpage (Hugo SSG)
- HTML 100%
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| config/_default | ||
| content/english | ||
| data/en | ||
| docs/adr | ||
| layouts | ||
| static/images | ||
| .gitignore | ||
| go.mod | ||
| go.sum | ||
| logo.png | ||
| README.md | ||
adaptif.de
Produkt-Landingpage, gebaut mit Hugo + Theme Vex Hugo.
Entwicklung
git clone https://github.com/themefisher/vex-hugo.git themes/vex-hugo
hugo server -D
Vor dem ersten Start müssen Hugo Modules geladen werden:
nix-shell -p hugo go --run "hugo mod tidy"
Build
git clone https://github.com/themefisher/vex-hugo.git themes/vex-hugo
nix-shell -p hugo go --run "hugo mod vendor && hugo"
# Output in public/
Deployment
Push auf main → Forgejo Actions baut und deployed automatisch.
Der CI-Workflow:
- Klont das Vex-Hugo-Theme in
themes/ - Vendored Hugo Modules via
hugo mod vendor - Baut mit
hugo - Kopiert
public/nach/var/www/adaptif.de/
Theme-Testing (Matrix-Build)
Für den Vergleich verschiedener Hugo-Themes gibt es ein Matrix-Build-Konzept.
Prinzip
- Jedes Theme bekommt einen eigenen Branch (
theme/<name>) - Der Branch enthält nur
config/_default/hugo.toml(mittheme = "...") – keincontent/ - Ein Matrix-Workflow checkt
mainaus, überlagertconfig/aus dem Theme-Branch, klont das Theme und baut - Content kommt immer frisch aus
main– nur das Theme und die Config variieren
Neues Theme testen
# Branch vom aktuellen main erstellen
git checkout main
git checkout -b theme/<name>
# content entfernen (wird aus main geholt)
git rm -r content/
# Theme setzen
cat > config/_default/hugo.toml << 'EOF'
baseURL = "https://adaptif.de/"
title = "adaptIF"
theme = "<theme-name>"
[markup.goldmark.renderer]
unsafe = true
EOF
# Kein module.toml nötig (wird in der Pipeline aus main übernommen und gelöscht)
git rm -f config/_default/module.toml 2>/dev/null; git rm -f go.mod go.sum 2>/dev/null; rm -rf _vendor
git add -A && git commit -m "theme: <name>"
git push origin theme/<name>
Workflow
Der Matrix-Workflow liegt in .forgejo/workflows/theme-matrix.yml (muss bei Bedarf aus dem Git-Verlauf oder aus dieser Doku wiederhergestellt werden):
name: Theme Build Matrix
on:
push:
branches: [theme/*]
workflow_dispatch:
jobs:
build:
strategy:
matrix:
include:
- branch: theme/blowfish
theme: blowfish
repo: https://github.com/nunocoracao/blowfish.git
- branch: theme/congo
theme: congo
repo: https://github.com/jpanther/congo.git
# … weitere Themes ergänzen
runs-on: nixos
steps:
- uses: actions/checkout@v4
with:
ref: main
- name: Overlay theme config
run: |
git checkout ${{ matrix.branch }} -- config/
rm -f config/_default/module.toml go.mod go.sum
rm -rf _vendor
- name: Clone theme
run: git clone --depth 1 ${{ matrix.repo }} themes/${{ matrix.theme }}
- run: hugo --minify
Wichtig: Bei Hugo Themes mit go.mod (Hugo Module-basiert) muss module.toml + go.mod/go.sum + _vendor/ nach dem Overlay gelöscht werden, damit Hugo im klassischen Theme-Modus läuft.
Geeignete Themes
| Theme | Repo | Typ |
|---|---|---|
| Blowfish | github.com/nunocoracao/blowfish | Hugo Module + Classic |
| Congo | github.com/jpanther/congo | Hugo Module + Classic |
| Hugo Profile | github.com/gurusabarish/hugo-profile | Classic |
| Stack | github.com/CaiJimmy/hugo-theme-stack | Hugo Module + Classic |
| PaperMod | github.com/adityatelange/hugo-PaperMod | Hugo Module + Classic |
| DoIt | github.com/HEIGE-PCloud/DoIt | Hugo Module + Classic |
| Lotus Docs | github.com/colinwilson/lotusdocs | Hugo Module + Classic |
Theme-Überlagen
Theme-Templates werden in layouts/ überlagert (Hugo's Override-Mechanismus):
layouts/_default/baseof.html–.Site.LanguageCode→.Site.Language.Localelayouts/partials/header.html– Logo + "adaptIF" Text, Header-Hintergrundlayouts/partials/banner.html,features.html, … –.Site.Data→hugo.Data
Struktur
config/_default/
├── hugo.toml # Theme-Konfiguration, Plugins, Parameter
├── languages.toml # Sprachkonfiguration (DE, content/english/)
├── menus.en.toml # Navigation (Start, FAQ, Impressum, Datenschutz)
└── module.toml # Hugo Modules (images)
content/english/
├── _index.md # Startseite
├── faq/index.md # FAQ-Seite
├── impressum/index.md # Impressum
└── datenschutz/index.md # Datenschutz
static/images/
└── logo.png # Logo (100px hoch, transparent)
themes/vex-hugo/ # (gitignored, wird im CI geklont)