Files
build_webstatic/README.md
T

85 lines
2.9 KiB
Markdown

# GCBoK.WebStaticBuilder
Eigenständiger, quelloffener **Static-Site-Generator** der GitCover Commons für
mehrsprachige, SEO-optimierte, compliance-freundliche Websites. Ersetzt den
früheren C#-Builderskript der GCBoK-Website durch ein generisches, für KMU
einsetzbares Werkzeug.
- **Sprache:** C# / .NET 10 (kompilierte Konsole)
- **Lizenz:** MIT
- **Kein Python:** einzige externe Abhängigkeit ist `npx pagefind` (Suchindex, optional)
- **Funktionen:** Markdown + YAML-Frontmatter → statisches HTML pro Sprache,
Navigation, SEO-Kopf (OpenGraph/JSON-LD), `sitemap.xml`, `robots.txt`,
Mermaid-Diagramme, client-seitige Volltextsuche (Pagefind), UI-Lokalisierung
über `{{ i18n.* }}`, optionaler Machine-Translation-Helfer (Entwürfe).
## Schnellstart
```bash
# Tool bauen
dotnet build -c Release
# Beispiel-Seite erzeugen und bauen
dotnet bin/Release/net10.0/webstatic.dll init mysite
cd mysite
dotnet ../../bin/Release/net10.0/webstatic.dll build --env development
# Lokal ansehen
dotnet ../../bin/Release/net10.0/webstatic.dll serve --port 8000
```
## Umgebungen
| `--env` | baseUrl (Beispiel) | Zweck |
|--------------|------------------------------|------------------------|
| `development`| `http://localhost:8000` | Lokale Entwicklung (work/preview/review) |
| `staging` | `https://gcbok.gitcover.org` | Abnahme (brx5) |
| `deploy` | `https://gcbok.org` | Production |
Aliase: `--preview` / `--work` / `--review` = `development`, `--staging` = `staging`, `--deploy` = `deploy`.
## Konfiguration (`webstatic.json`)
CLI-Flags haben Vorrang vor `webstatic.json`, dieses vor eingebauten Defaults.
Siehe `webstatic.example/webstatic.json` und `docs/getting-started.md`.
## Installation für KMU
```bash
./install.sh # -> /opt/GitCover/webstatic, Symlink /usr/local/bin/webstatic
```
## Version & Update
```bash
webstatic --version # Assembly-Version + Git-Commit des Installations-Repos
webstatic update # Selbstaktualisierung (Clone-Installation): lokale
# Änderungen werden gestasht, git pull, gemerged, neu gebaut
```
`webstatic update` setzt eine Clone-Installation voraus (siehe `install.sh`,
Default `WEBSTATIC_INSTALL_MODE=clone`). Bei einer Copy-Installation erfolgt das
Update via erneutem `./install.sh`.
## Machine Translation (optional)
```bash
webstatic translate --check # fehlende Übersetzungen melden
export WEBSTATIC_TRANSLATOR_KEY=... # API-Key (Azure/DeepL)
webstatic translate --draft # Entwürfe nach .translation-drafts/
```
Entwürfe überschreiben niemals Quelldateien.
## Verzeichnisstruktur
```
plans/ Produktplan & Folgepläne
docs/ Anleitungen (KMU, Admin)
diary/ Entwicklungs-Tagebuch
src/ C#-Quellcode (GCBoK.WebStaticBuilder)
tests/ (künftig) Unit/Integrationstests
webstatic.example/ Vorlage-Site für KMU
install.sh KMU-Installation
```