# CodePress CMS
**[π³π± Nederlands](#) | [π¬π§ English](README.en.md)**
Een lichtgewicht, file-based content management systeem gebouwd met PHP.
**Versie:** 1.0.0 | **Licentie:** AGPL v3 / Commercial
## β¨ Features
- π **Multi-format Content** - Ondersteunt Markdown, PHP en HTML bestanden
- π§ **Dynamic Navigation** - Automatische menu generatie met dropdowns
- π **Search Functionality** - Volledige tekst zoek door alle content
- π§ **Breadcrumb Navigation** - IntuΓ―tieve navigatiepaden
- π **Auto-linking** - Automatische links tussen pagina's
- π± **Responsive Design** - Werkt perfect op alle apparaten
- βοΈ **JSON Configuratie** - Eenvoudige configuratie via JSON
- π¨ **Bootstrap 5** - Moderne UI framework
- π **Security** - Beveiligde content management
## π Quick Start
1. **Upload** bestanden naar webserver
2. **Stel permissies** in voor webserver
3. **Configureer** (optioneel) via `config.json`
4. **Bezoek** website via browser
## π Project Structuur
```
codepress/
βββ engine/
β βββ core/
β β βββ config.php # Configuratie loader
β β βββ index.php # CMS engine
β βββ templates/ # Template bestanden
β βββ layout.mustache
β βββ assets/
β β βββ header.mustache
β β βββ navigation.mustache
β β βββ footer.mustache
β βββ markdown_content.mustache
β βββ php_content.mustache
β βββ html_content.mustache
βββ content/ # Content bestanden
β βββ map1/
β β βββ pagina1.md
β β βββ pagina2.php
β βββ homepage.md
βββ public/ # Web root
β βββ assets/
β β βββ css/
β β βββ js/
β β βββ favicon.svg
β βββ index.php
βββ config.json # Configuratie
βββ README.md
```
## βοΈ Configuratie
### Basis Configuratie (`config.json`)
```json
{
"site_title": "CodePress",
"content_dir": "content",
"templates_dir": "engine/templates",
"default_page": "auto",
"homepage": "homepage",
"author": {
"name": "Edwin Noorlander",
"website": "https://noorlander.info",
"git": "https://git.noorlander.info/E.Noorlander/CodePress.git"
},
"seo": {
"description": "CodePress CMS - Lightweight file-based content management system",
"keywords": "cms, php, content management, file-based"
}
}
```
### Configuratie Opties
- **`site_title`** - Naam van de website
- **`content_dir`** - Map met content bestanden
- **`templates_dir`** - Map met template bestanden
- **`default_page`** - Standaard pagina (`"auto"` voor automatische detectie)
- **`homepage`** - Homepage (`"auto"` voor automatische detectie)
- **`author`** - Auteur informatie met links
- **`seo`** - SEO instellingen
## π Content Types
### Markdown (.md)
- Auto-linking tussen pagina's
- GitHub Flavored Markdown ondersteuning
- Syntax highlighting voor code blocks
- Automatische titel extractie
### PHP (.php)
- Volledige PHP ondersteuning
- Dynamische content generatie
- Database integratie mogelijk
- Session management beschikbaar
### HTML (.html)
- Statische HTML pagina's
- Bootstrap componenten
- Custom CSS en JavaScript
- Volledige HTML5 validatie
## π¨ Design Features
### Navigation
- **Tab-style navigatie** met Bootstrap
- **Dropdown menus** voor mappen en sub-mappen
- **Home knop** met icoon
- **Active state** indicatie
- **Responsive** hamburger menu
### Layout
- **Flexbox layout** voor moderne structuur
- **Fixed header** met logo en zoekfunctie
- **Breadcrumb navigatie** tussen header en content
- **Fixed footer** met metadata
- **Scrollable content** gebied
### Responsive
- **Mobile-first** aanpak
- **Touch-friendly** interactie
- **Adaptieve** breedtes
- **Consistente** ervaring
## π§ Vereisten
- **PHP 8.4+** of hoger
- **Webserver** (Apache, Nginx, etc.)
- **Schrijfrechten** voor PHP bestanden
- **Mod_rewrite** (optioneel voor pretty URLs)
## π οΈ Installatie
### Via Composer
```bash
composer create-project codepress
cd codepress
```
### Handmatig
1. **Download** de bestanden
2. **Upload** naar webserver
3. **Stel permissies** in
4. **Configureer** `config.json`
### Webserver Configuratie
#### Apache
```apache
AllowOverride All
Require all granted
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]
```
#### Nginx
```nginx
server {
root /var/www/codepress/public;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
}
```
## ποΈ PHP Classes
### SimpleTemplate Class
Lightweight template rendering engine die Mustache-style syntax ondersteunt zonder externe dependencies.
**Methods:**
- `render($template, $data)` - Rendert template met data
- `replacePartial($matches)` - Vervangt `{{>partial}}` placeholders
**Features:**
- `{{>partial}}` - Partial includes
- `{{#variable}}...{{/variable}}` - Conditionele blocks
- `{{^variable}}...{{/variable}}` - Negatieve conditionele blocks
- `{{{variable}}}` - Unescaped HTML content
- `{{variable}}` - Escaped content
### CodePressCMS Class
Hoofd CMS class die alle content management functionaliteit beheert.
**Public Methods:**
- `__construct($config)` - Initialiseer CMS met configuratie
- `getPage()` - Haalt huidige pagina content op
- `getMenu()` - Genereert navigatiestructuur
- `render()` - Rendert volledige pagina met templates
**Private Methods:**
- `buildMenu()` - Bouwt menu structuur van content directory
- `scanDirectory($dir, $prefix)` - Scant directory voor content
- `performSearch($query)` - Voert zoekopdracht uit
- `parseMarkdown($content)` - Converteert Markdown naar HTML
- `parsePHP($filePath)` - Verwerkt PHP bestanden
- `parseHTML($content)` - Verwerkt HTML bestanden
- `getBreadcrumb()` - Genereert breadcrumb navigatie
- `renderMenu($items, $level)` - Rendert menu HTML
- `getContentType($page)` - Bepaalt content type
- `autoLinkPageTitles($content)` - Auto-link pagina titels
**Features:**
- Multi-format content support (MD, PHP, HTML)
- Dynamische navigatie met dropdowns
- Zoekfunctionaliteit met snippets
- Breadcrumb navigatie
- Auto-linking tussen pagina's
- File metadata tracking
- Responsive template rendering
## π Documentatie
- **[Handleiding (NL)](guide/nl.md)** - Gedetailleerde handleiding
- **[Handleiding (EN)](guide/en.md)** - English documentation
- **[AGENTS.md](AGENTS.md)** - Ontwikkelaar instructies
## π€ Bijdragen
Bijdragen zijn welkom! Zie [AGENTS.md](AGENTS.md) voor ontwikkelrichtlijnen.
## π Licentie
CodePress CMS is beschikbaar onder een **dual-license model**:
### π AGPL v3 (Open-Source)
- **Gratis** voor niet-commercieel gebruik
- **Vereist** het delen van wijzigingen
- **Copyleft** bescherming
- Zie [LICENSE](LICENSE) voor details
### πΌ Commercial License
Voor bedrijfsmatig gebruik zonder AGPL verplichtingen:
- **Individual:** β¬99 (1 developer)
- **Business:** β¬499 (10 developers)
- **Enterprise:** β¬2499 (unlimited)
- **SaaS:** β¬999/jaar
π§ **Contact:** commercial@noorlander.info
π **Meer info:** [LICENSE-INFO.md](LICENSE-INFO.md)
## π Links
- **Website**: https://noorlander.info
- **Repository**: https://git.noorlander.info/E.Noorlander/CodePress.git
- **Issues**: https://git.noorlander.info/E.Noorlander/CodePress/issues
---
*Gebouwd met β€οΈ door Edwin Noorlander*