Decap CMS Einrichtung
Decap CMS Einrichtung
Übersicht
Decap CMS (früher Netlify CMS) ist ein Headless CMS für statische Websites. Es ermöglicht die Bearbeitung von Blog-Posts über eine webbasierte Oberfläche.
Voraussetzungen
- GitHub Repository:
seebinator/dos-aguas-website - Website deployed (z.B. Vercel, Netlify, oder eigener Server)
Option 1: Netlify Identity (Einfachste)
Schritt 1: Website auf Netlify deployen
- Gehe zu netlify.com
- Klicke "Add new site" → "Import an existing project"
- Wähle GitHub und das Repository
seebinator/dos-aguas-website - Build settings:
- Build command:
npm run build - Publish directory:
out
- Build command:
- Klicke "Deploy site"
Schritt 2: Netlify Identity aktivieren
- Im Netlify Dashboard → "Identity"
- Klicke "Enable Identity"
- Gehe zu "Settings" → "Registration"
- Setze "Registration preferences" auf "Invite only" (empfohlen)
- Gehe zu "Services" → "Git Gateway"
- Klicke "Enable Git Gateway"
- Autorisiere mit GitHub
Schritt 3: Admin-Zugang einrichten
- Gehe zu "Identity" → "Users"
- Klicke "Invite users"
- Gib deine E-Mail-Adresse ein
- Rolle: "Admin"
- Klicke "Send"
- Akzeptiere die Einladung per E-Mail
Schritt 4: CMS nutzen
- Öffne
https://deine-site.netlify.app/admin/ - Klicke "Login with Netlify Identity"
- Gib deine E-Mail und Passwort ein
- Du kannst jetzt Blog-Posts erstellen und bearbeiten
Option 2: Vercel + Git Gateway
Schritt 1: Vercel Project erstellen
- Gehe zu vercel.com
- Klicke "Add New..." → "Project"
- Importiere
seebinator/dos-aguas-website - Framework Preset: "Next.js"
- Klicke "Deploy"
Schritt 2: Git Gateway einrichten
Da Vercel kein eingebautes Identity hat:
- Erstelle einen Account auf netlify.com
- Gehe zu "Sites" → "Add new site" → "Deploy manually"
- Dies dient nur für Git Gateway, die Website läuft auf Vercel
- Aktiviere Identity und Git Gateway wie in Option 1 beschrieben
Option 3: GitHub OAuth
Schritt 1: GitHub OAuth App erstellen
- Gehe zu GitHub → Settings → Developer settings → OAuth Apps
- Klicke "New OAuth App"
- Application name: "Dos Aguas CMS"
- Homepage URL:
https://dos-aguas.consulting - Authorization callback URL:
https://dos-aguas.consulting/admin/ - Klicke "Register application"
- Notiere Client ID und Client Secret
Schritt 2: Config anpassen
Ändere public/admin/config.yml:
backend:
name: github
repo: seebinator/dos-aguas-website
branch: main
Empfohlene Lösung
Option 1 (Netlify) ist am einfachsten:
- Deploye auf Netlify (kostenlos)
- Aktiviere Identity
- Fertig
CMS Nutzung
Blog-Post erstellen:
- Öffne
/admin/ - Wähle "Blog (Deutsch)" oder "Blog (Español)"
- Klicke "New Blog (Deutsch)"
- Fülle alle Felder aus:
- Titel
- Datum
- Autor
- Agent (für Filter)
- Kategorie (für Filter)
- Bild (Upload oder URL)
- Zusammenfassung
- Inhalt (Markdown)
- Klicke "Save" → Erstellt einen Git Commit
- Klicke "Publish" → Pusht zu GitHub
Bilder hochladen:
- Im "Bild"-Feld auf "Choose different image" klicken
- Bild auswählen oder per Drag & Drop hochladen
- Bild wird automatisch nach
public/images/blog/gespeichert
Troubleshooting
"Failed to load entries"
- Prüfe Git Gateway Konfiguration
- Stelle sicher, dass das Repository öffentlich ist oder der Zugriff erlaubt ist
"Login not working"
- Prüfe Identity-Einstellungen in Netlify
- Stelle sicher, dass die E-Mail bestätigt ist
"Changes not saving"
- Prüfe Git Gateway Berechtigungen
- Stelle sicher, dass der GitHub Token gültig ist
Support
- Decap CMS Docs: https://decapcms.org/docs/
- Netlify Identity: https://docs.netlify.com/visitor-access/identity/
- Git Gateway: https://github.com/netlify/git-gateway