Vervang raw JSON config editor door instellingenformulier met default_page dropdown

- Admin config pagina is nu een formulier met secties voor algemeen, taal,
  SEO, auteur en features
- Startpagina instelbaar via dropdown met beschikbare pagina's uit content/
- Handleiding (nl/en) bijgewerkt met nieuwe configuratie-instructies
This commit is contained in:
2026-07-28 13:49:33 +02:00
parent 4bb138eb92
commit e85f6e91e1
4 changed files with 218 additions and 55 deletions
+20 -12
View File
@@ -31,8 +31,8 @@ CodePress CMS is a lightweight, file-based content management system built with
- Search URL: `?search=query`
### Configuration
- **JSON configuration** in `config.json`
- Dynamic homepage setting (`default_page`)
- **Settings form** in admin panel via `/admin/config`
- Dynamic homepage setting via dropdown
- SEO settings (description, keywords)
- Author information with links
- Theme configuration via `themes/` directory
@@ -58,7 +58,7 @@ CodePress CMS is a lightweight, file-based content management system built with
- **CodeMirror editor** with toolbar (bold, italic, heading, link, image, list, media insert)
- **Media browser modal** in the editor for selecting images/files
- **Directory management** - Create, rename and delete directories (empty only)
- **Configuration editor** - Edit `config.json` with JSON validation
- **Configuration editor** - Settings form for site configuration (title, homepage, language, SEO, author, features)
- **Theme management** - Create, activate, edit (colors, background) and delete themes
- **Plugin management** - Overview, create, edit, configure, enable/disable and delete
- **Media management** - Upload and delete media files in `content/-assets/`
@@ -157,7 +157,19 @@ codepress/
## Configuration
### Basic Configuration (`config.json`)
### Basic Configuration
The site configuration is managed via the **admin panel** at `/admin/config`. Here you'll find a settings form with the following sections:
- **General settings** - Site title and homepage (dropdown with available pages)
- **Language** - Default language and available languages
- **SEO** - Meta description and keywords
- **Author** - Name and website
- **Features** - Auto-link pages, search, breadcrumbs, show version
The configuration is stored in `config.json`. You can also edit this file manually for advanced options like `active_theme`, `content_dir` and `templates_dir`.
### Example `config.json`
```json
{
@@ -186,11 +198,6 @@ codepress/
}
```
- `active_theme` - Determines which theme from `themes/` is active
- `templates_dir` - Directory with Mustache templates (`cms/templates`)
- `default_page` - Default page (e.g. `index`)
- `content_dir` - Directory with content files (usually not changed)
### Theme Configuration (`themes/<name>/theme.json`)
```json
@@ -268,7 +275,7 @@ Media files (images, PDFs, video, audio) can be placed in any `content/` subdire
| `content-dir-rename` | Rename directory |
| `content-dir-create` | Create directory (POST) |
| `content-dir-delete` | Delete directory (empty only) |
| `config` | Configuration editor (`config.json`) |
| `config` | Configuration form (title, homepage, language, SEO, author, features) |
| `theme` | Theme management |
| `plugins` | Plugin overview |
| `plugins-new` | Create new plugin |
@@ -499,8 +506,9 @@ The MQTTTracker plugin stores `broker_host`, `broker_port`, `client_id`, `userna
### How do I set the homepage?
1. **Automatic**: Set `"default_page": "index"` in `config.json` (or omit the field)
2. **Manual**: Set `"default_page": "page-name"` in `config.json`
1. Go to **Configuration** in the admin panel (`/admin/config`)
2. Select the desired page in the **Default/homepage** dropdown
3. Click **Save configuration**
### How does navigation work?
+20 -12
View File
@@ -31,8 +31,8 @@ CodePress CMS is een lichtgewicht, file-based content management systeem gebouwd
- Search URL: `?search=zoekterm`
### Configuratie
- **JSON configuratie** in `config.json`
- Dynamische homepage instelling (`default_page`)
- **Instellingenformulier** in admin paneel via `/admin/config`
- Dynamische homepage instelling via dropdown
- SEO instellingen (description, keywords)
- Author informatie met links
- Thema configuratie via `themes/` directory
@@ -58,7 +58,7 @@ CodePress CMS is een lichtgewicht, file-based content management systeem gebouwd
- **CodeMirror editor** met toolbar (vet, cursief, kop, link, afbeelding, lijst, media invoegen)
- **Media browser modal** in de editor voor het selecteren van afbeeldingen/bestanden
- **Map beheer** - Mappen aanmaken, hernoemen en verwijderen (alleen lege mappen)
- **Configuratie editor** - `config.json` bewerken met JSON-validatie
- **Configuratie editor** - Instellingenformulier voor site configuratie (titel, startpagina, taal, SEO, auteur, features)
- **Thema beheer** - Thema's aanmaken, activeren, bewerken (kleuren, achtergrond) en verwijderen
- **Plugin beheer** - Overzicht, aanmaken, bewerken, configureren, in-/uitschakelen en verwijderen
- **Media beheer** - Uploaden en verwijderen van mediabestanden in `content/-assets/`
@@ -157,7 +157,19 @@ codepress/
## Configuratie
### Basis Configuratie (`config.json`)
### Basis Configuratie
De site configuratie wordt beheerd via het **admin paneel** op `/admin/config`. Hier vind je een instellingenformulier met de volgende secties:
- **Algemene instellingen** - Site titel en startpagina (dropdown met beschikbare pagina's)
- **Taal** - Standaard taal en beschikbare talen
- **SEO** - Meta beschrijving en keywords
- **Auteur** - Naam en website
- **Features** - Auto-link pagina's, zoekfunctie, breadcrumbs, versie tonen
De configuratie wordt opgeslagen in `config.json`. Je kunt dit bestand ook handmatig bewerken voor geavanceerde opties zoals `active_theme`, `content_dir` en `templates_dir`.
### Voorbeeld `config.json`
```json
{
@@ -186,11 +198,6 @@ codepress/
}
```
- `active_theme` - Bepaalt welk thema uit `themes/` actief is
- `templates_dir` - Map met Mustache templates (`cms/templates`)
- `default_page` - Standaard pagina (bijv. `index`)
- `content_dir` - Map met content bestanden (wordt gewoonlijk niet gewijzigd)
### Thema Configuratie (`themes/<naam>/theme.json`)
```json
@@ -269,7 +276,7 @@ Media bestanden (afbeeldingen, PDFs, video, audio) kunnen in elke `content/` sub
| `content-dir-rename` | Map hernoemen |
| `content-dir-create` | Map aanmaken (POST) |
| `content-dir-delete` | Map verwijderen (alleen leeg) |
| `config` | Configuratie editor (`config.json`) |
| `config` | Configuratieformulier (titel, startpagina, taal, SEO, auteur, features) |
| `theme` | Thema beheer |
| `plugins` | Plugin overzicht |
| `plugins-new` | Nieuwe plugin aanmaken |
@@ -500,8 +507,9 @@ De MQTTTracker plugin slaat `broker_host`, `broker_port`, `client_id`, `username
### Hoe stel ik de homepage in?
1. **Automatisch**: Zet `"default_page": "index"` in `config.json` (of verwijder het veld)
2. **Handmatig**: Stel `"default_page": "pagina-naam"` in `config.json`
1. Ga naar **Configuratie** in het admin paneel (`/admin/config`)
2. Selecteer de gewenste pagina in het **Standaard/startpagina** dropdown
3. Klik op **Configuratie opslaan
### Hoe werkt de navigatie?