File-based admin panel accessible at /admin.php with: - Session-based auth with bcrypt hashing and brute-force protection - Dashboard with site statistics and quick actions - Content manager: browse, create, edit, delete files - Config editor with JSON validation - Plugin overview with status indicators - User management: add, remove, change passwords - CSRF protection on all forms, path traversal prevention - Updated README (NL/EN) and guides with admin documentation
300 lines
7.5 KiB
Markdown
300 lines
7.5 KiB
Markdown
# CodePress CMS Handleiding
|
|
|
|
## Overzicht
|
|
|
|
CodePress CMS is een lichtgewicht, file-based content management systeem gebouwd met PHP. Werkt zonder database.
|
|
|
|
## Functies
|
|
|
|
### 🏠 Navigatie
|
|
- Tab-style navigatie met Bootstrap styling
|
|
- Dropdown menus voor mappen en sub-mappen
|
|
- Home knop met icoon
|
|
- Automatische menu generatie
|
|
- Responsive design
|
|
- Breadcrumb navigatie met sidebar toggle
|
|
- Active state marking
|
|
- **Sidebar toggle** - Knop links van HOME in de breadcrumb om de sidebar te openen/sluiten. Het icoon wisselt tussen open en gesloten status. De keuze blijft behouden tijdens de sessie
|
|
|
|
### 📄 Content Types
|
|
- **Markdown (.md)** - CommonMark ondersteuning
|
|
- **PHP (.php)** - Dynamische content
|
|
- **HTML (.html)** - Statische HTML pagina's
|
|
- **Directory listings** - Automatische directory overzichten
|
|
- **Language-specific content** - `nl.` en `en.` prefix
|
|
|
|
### 🔍 Zoekfunctionaliteit
|
|
- Volledige tekst zoek door alle content
|
|
- Resultaten met snippets en highlighting
|
|
- Directe navigatie naar gevonden pagina's
|
|
- SEO-vriendelijke zoekresultaten
|
|
- Search URL: `?search=zoekterm`
|
|
|
|
### 🧭 Configuratie
|
|
- **JSON configuratie** in `config.json`
|
|
- Dynamische homepage instelling
|
|
- SEO instellingen (description, keywords)
|
|
- Author informatie met links
|
|
- Thema configuratie met kleuren
|
|
- Language settings
|
|
- Feature toggles
|
|
|
|
### 🎨 Layout & Design
|
|
- Flexbox layout voor responsive structuur
|
|
- Fixed header met logo en zoekfunctie
|
|
- Breadcrumb navigatie
|
|
- Fixed footer met file info en links
|
|
- Bootstrap 5 styling
|
|
- Mustache templates
|
|
- Semantic HTML5 structuur
|
|
- **Dynamic layouts** met YAML frontmatter
|
|
- **Sidebar support** met plugin integratie en toggle functie via breadcrumb
|
|
|
|
### 🛡️ Admin Console
|
|
- Ingebouwd admin paneel op `/admin.php`
|
|
- **Dashboard** met statistieken en snelle acties
|
|
- **Content beheer** - Bestanden browsen, aanmaken, bewerken en verwijderen
|
|
- **Configuratie editor** - `config.json` bewerken met JSON-validatie
|
|
- **Plugin overzicht** - Status van alle geinstalleerde plugins
|
|
- **Gebruikersbeheer** - Gebruikers toevoegen, verwijderen, wachtwoorden wijzigen
|
|
- Session-based authenticatie met bcrypt hashing
|
|
- CSRF-bescherming, brute-force lockout (5 pogingen, 15 min)
|
|
- Standaard login: `admin` / `admin` (wijzig direct na installatie)
|
|
|
|
## Installatie
|
|
|
|
1. Upload bestanden naar webserver
|
|
2. Stel permissies in voor webserver
|
|
3. Configureer `config.json` indien nodig
|
|
4. Toegang tot website via browser
|
|
|
|
## Configuratie
|
|
|
|
### Basis Configuratie (`config.json`)
|
|
|
|
\`\`\`json
|
|
{
|
|
"site_title": "CodePress",
|
|
"content_dir": "content",
|
|
"templates_dir": "engine/templates",
|
|
"default_page": "auto",
|
|
"language": {
|
|
"default": "nl",
|
|
"available": ["nl", "en"]
|
|
},
|
|
"theme": {
|
|
"header_color": "#0a369d",
|
|
"header_font_color": "#ffffff",
|
|
"navigation_color": "#2754b4",
|
|
"navigation_font_color": "#ffffff",
|
|
"sidebar_background": "#f8f9fa",
|
|
"sidebar_border": "#dee2e6"
|
|
},
|
|
"author": {
|
|
"name": "E. Noorlander",
|
|
"website": "https://noorlander.info"
|
|
},
|
|
"seo": {
|
|
"description": "CodePress CMS - Lightweight file-based content management system",
|
|
"keywords": "cms, php, content management, file-based"
|
|
},
|
|
"features": {
|
|
"auto_link_pages": true,
|
|
"search_enabled": true,
|
|
"breadcrumbs_enabled": true
|
|
}
|
|
}
|
|
\`\`\`
|
|
|
|
## Content Structuur
|
|
|
|
### Bestandsstructuur
|
|
|
|
\`\`\`
|
|
content/
|
|
├── map1/
|
|
│ ├── submap1/
|
|
│ │ ├── pagina1.md
|
|
│ │ └── pagina2.php
|
|
│ └── pagina3.html
|
|
├── map2/
|
|
│ └── pagina4.md
|
|
├── homepage.md
|
|
└── index.html
|
|
\`\`\`
|
|
|
|
### Bestandsnamen
|
|
|
|
- Gebruik lowercase bestandsnamen
|
|
- Geen spaties - gebruik `-` of `_`
|
|
- Logische extensies - `.md`, `.php`, `.html`
|
|
- Unieke namen - geen duplicaten
|
|
- Language prefixes - `nl.bestand.md` en `en.bestand.md`
|
|
|
|
## Templates
|
|
|
|
### Template Variabelen
|
|
|
|
#### Site Info
|
|
- `site_title` - Website titel
|
|
- `author_name` - Auteur naam
|
|
- `author_website` - Auteur website
|
|
- `author_git` - Git repository link
|
|
|
|
#### Page Info
|
|
- `page_title` - Pagina titel
|
|
- `content` - Content (HTML)
|
|
- `file_info` - Bestandsinformatie
|
|
- `is_homepage` - Boolean: is dit de homepage?
|
|
|
|
#### Navigation
|
|
- `menu` - Navigatie menu
|
|
- `breadcrumb` - Breadcrumb navigatie
|
|
- `homepage` - Homepage link
|
|
|
|
#### Theme
|
|
- `header_color` - Header achtergrondkleur
|
|
- `header_font_color` - Header tekstkleur
|
|
- `navigation_color` - Navigatie achtergrondkleur
|
|
- `navigation_font_color` - Navigatie tekstkleur
|
|
|
|
#### Language
|
|
- `current_lang` - Huidige taal (nl/en)
|
|
- `current_lang_upper` - Huidige taal (NL/EN)
|
|
- `t_*` - Vertaalde strings
|
|
|
|
## URL Structuur
|
|
|
|
### Basis URLs
|
|
- **Home**: `/` of `?page=home`
|
|
- **Pagina**: `?page=map/pagina`
|
|
- **Zoeken**: `?search=zoekterm`
|
|
- **Handleiding**: `?guide`
|
|
- **Language**: `?lang=nl` of `?lang=en`
|
|
|
|
## SEO Optimalisatie
|
|
|
|
### Meta Tags
|
|
|
|
De CMS voegt automatisch meta tags toe:
|
|
\`\`\`html
|
|
<meta name="generator" content="CodePress CMS">
|
|
<meta name="author" content="E. Noorlander">
|
|
<meta name="description" content="...">
|
|
<meta name="keywords" content="...">
|
|
\`\`\`
|
|
|
|
## 🔌 Plugin Systeem
|
|
|
|
### Plugin Structuur
|
|
|
|
\`\`\`
|
|
plugins/
|
|
├── README.md
|
|
├── HTMLBlock/
|
|
│ ├── HTMLBlock.php
|
|
│ └── README.md
|
|
└── MQTTTracker/
|
|
├── MQTTTracker.php
|
|
├── config.json
|
|
└── README.md
|
|
\`\`\`
|
|
|
|
### Plugin Development
|
|
|
|
- **API toegang** via `CMSAPI` class
|
|
- **Sidebar content** met `getSidebarContent()`
|
|
- **Metadata toegang** uit YAML frontmatter
|
|
- **Configuratie** via JSON bestanden
|
|
|
|
### Beschikbare Plugins
|
|
|
|
- **HTMLBlock** - Custom HTML blokken in sidebar
|
|
- **MQTTTracker** - Real-time analytics en tracking
|
|
|
|
## 🎯 Template Systeem
|
|
|
|
### Layout Opties
|
|
|
|
Gebruik YAML frontmatter om layout te selecteren:
|
|
|
|
\`\`\`yaml
|
|
---
|
|
title: Mijn Pagina
|
|
layout: sidebar-content
|
|
---
|
|
\`\`\`
|
|
|
|
### Beschikbare Layouts
|
|
|
|
- `sidebar-content` - Sidebar links, content rechts (standaard)
|
|
- `content` - Alleen content (volle breedte)
|
|
- `sidebar` - Alleen sidebar
|
|
- `content-sidebar` - Content links, sidebar rechts
|
|
- `content-sidebar-reverse` - Content rechts, sidebar links
|
|
|
|
### Meta Data
|
|
|
|
\`\`\`yaml
|
|
---
|
|
title: Pagina Titel
|
|
layout: content-sidebar
|
|
description: Pagina beschrijving
|
|
author: Auteur Naam
|
|
date: 2025-11-26
|
|
---
|
|
\`\`\`
|
|
|
|
## 📊 Analytics & Tracking
|
|
|
|
### MQTT Tracker
|
|
|
|
- Real-time page tracking
|
|
- Session management
|
|
- Business Intelligence data
|
|
- Privacy aware (GDPR compliant)
|
|
- MQTT integration voor dashboards
|
|
|
|
## Veelgestelde Vragen
|
|
|
|
### Hoe stel ik de homepage in?
|
|
|
|
1. **Automatisch**: Laat de CMS het eerste bestand kiezen
|
|
2. **Handmatig**: Stel `"default_page": "pagina-naam"` in `config.json`
|
|
|
|
### Hoe werkt de navigatie?
|
|
|
|
- **Mappen** worden dropdown menus
|
|
- **Bestanden** worden directe links
|
|
- **Sub-mappen** worden geneste dropdowns
|
|
|
|
### Hoe voeg ik nieuwe content toe?
|
|
|
|
1. Upload bestanden naar de `content/` map
|
|
2. Organiseer in logische mappen
|
|
3. Gebruik juiste bestandsnamen en extensies
|
|
|
|
## Troubleshooting
|
|
|
|
### Pagina niet gevonden (404)
|
|
|
|
1. Controleer bestandsnaam en pad
|
|
2. Controleer bestandsextensie (.md, .php, .html)
|
|
3. Controleer permissies van bestanden
|
|
|
|
### Navigatie niet bijgewerkt
|
|
|
|
1. Herlaad de pagina
|
|
2. Controleer content map structuur
|
|
3. Controleer bestandsnamen (geen spaties)
|
|
|
|
## Ondersteuning
|
|
|
|
Voor technische ondersteuning:
|
|
- **Git**: https://git.noorlander.info/E.Noorlander/CodePress
|
|
- **Website**: https://noorlander.info
|
|
- **Issues**: Rapporteer problemen via [Git issues](https://git.noorlander.info/E.Noorlander/CodePress/issues)
|
|
|
|
## Licentie
|
|
|
|
CodePress CMS is open-source software. |