explain hugo docs site

This commit is contained in:
goeranh 2026-03-13 18:17:49 +01:00
parent 8703e7df98
commit 47d48d193d
No known key found for this signature in database

View file

@ -58,6 +58,50 @@ HAProxy routes traffic using two methods:
- TCP keep-alive enabled - TCP keep-alive enabled
- Used for accessing legacy systems - Used for accessing legacy systems
### Documentation Site (Hugo)
The proxy hosts a self-documenting Hugo site at **docs.adm.htw.stura-dresden.de** that automatically builds from README files across the repository.
**Architecture:**
1. **Hugo Package Build** (in flake.nix):
- `docs-site` package built using `stdenv.mkDerivation`
- Uses Hugo static site generator with the hugo-book theme
- Script `docs/build-docs.sh` collects README files from:
- Main `README.md` → homepage
- `CLAUDE.md` → Claude Code guide page
- `hosts/*/README.md` → individual host documentation
- `keys/README.md` → key management guide
- Converts relative markdown links to work with Hugo's URL structure
- Builds static HTML site and stores it in the Nix store
2. **Local Nginx Server**:
- Serves the Hugo site on localhost only (not directly accessible)
- HTTP on 127.0.0.1:8080
- HTTPS on 127.0.0.1:8443
- Uses ACME certificate for `docs.adm.htw.stura-dresden.de`
- Clean URL handling: `try_files $uri $uri/ $uri.html =404`
3. **HAProxy Forwarding**:
- External requests to docs.adm.htw.stura-dresden.de forwarded to local nginx
- Entry in the `forwards` map routes port 80 → 8080, port 443 → 8443
- ACME challenges forwarded for automatic certificate renewal
**Updating Documentation:**
Just edit any README file in the repository and redeploy the proxy:
```bash
nix run .#proxy-update
```
The Hugo site will rebuild with the latest content from all README files.
**Hugo Configuration:**
- Config: `docs/hugo.yaml`
- Theme: hugo-book v13 (alex-shpak/hugo-book)
- Base URL: https://docs.adm.htw.stura-dresden.de/
- Repository link: https://codeberg.org/stura-htw-dresden/stura-infra
### Auto-Generated Forwarding ### Auto-Generated Forwarding
The proxy configuration is **partially auto-generated**: The proxy configuration is **partially auto-generated**:
@ -262,6 +306,7 @@ This generates:
The proxy currently forwards traffic for: The proxy currently forwards traffic for:
**In this repository:** **In this repository:**
- docs.adm.htw.stura-dresden.de → 127.0.0.1 (Hugo documentation site, ports 8080/8443)
- git.adm.htw.stura-dresden.de → 141.56.51.7 (Forgejo) - git.adm.htw.stura-dresden.de → 141.56.51.7 (Forgejo)
- wiki.htw.stura-dresden.de → 141.56.51.13 (MediaWiki) - wiki.htw.stura-dresden.de → 141.56.51.13 (MediaWiki)
- pro.htw.stura-dresden.de → 141.56.51.15 (Redmine) - pro.htw.stura-dresden.de → 141.56.51.15 (Redmine)