Add preview template config and starter static site.

Includes .webklar-preview.json for automatic deployment to
*.project.webklar.com via the Webklar preview webhook.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Webklar
2026-05-21 12:07:38 +00:00
commit c21c4f5a14
4 changed files with 118 additions and 0 deletions

60
README.md Normal file
View File

@@ -0,0 +1,60 @@
# webklar-preview-template
Vorlage fuer Kunden-Websites mit automatischer Preview unter `*.project.webklar.com`.
## Preview aktivieren
Dieses Repo enthaelt [`.webklar-preview.json`](.webklar-preview.json). Beim Push auf den konfigurierten Branch startet der Deploy:
- URL: `https://project.webklar.com/webhook/gitea`
- Vorschau: `https://<subdomain>.project.webklar.com`
## Konfiguration (`.webklar-preview.json`)
| Feld | Beschreibung |
|------|----------------|
| `enabled` | `true` = Preview-Deploy aktiv |
| `type` | `static` (Dateien direkt) oder `node_build` (npm build) |
| `branch` | Branch fuer Deploy, z. B. `main` |
| `displayName` | Anzeigename im Kundenportal |
| `subdomain` | Optional; Default = Repo-Name |
**Keine Passwoerter** in dieser Datei.
### Beispiel fuer statische Seite
```json
{
"enabled": true,
"type": "static",
"branch": "main",
"displayName": "Friseur Mueller",
"subdomain": "friseur-mueller"
}
```
### Beispiel fuer Vite/React (Build)
```json
{
"enabled": true,
"type": "node_build",
"branch": "main",
"displayName": "Restaurant Demo",
"subdomain": "restaurant-demo"
}
```
## Neues Projekt aus dieser Vorlage
1. In Gitea: **Use this template** / Repository aus Template erstellen
2. `displayName` und `subdomain` in `.webklar-preview.json` anpassen
3. Website-Inhalt ersetzen (`index.html` oder eigenes Frontend)
4. Push auf `main` <20> Webhook deployt automatisch
5. Im Admin-Portal (`project.webklar.com`) Kunde dem Projekt zuweisen
## Gitea-Webhook (einmalig pro Org/Repo)
- **URL:** `https://project.webklar.com/webhook/gitea`
- **Secret:** `GITEA_WEBHOOK_TOKEN` (Server-`.env`)
- **Events:** Push