Update documentation with complete feature coverage

- Add language support documentation
- Document all template variables and configuration options
- Add URL structure and routing information
- Include directory listings and file naming conventions
- Document search functionality and SEO features
- Add breadcrumb navigation and theme customization
- Include security features and responsive design
- Update both English and Dutch guides

Guides now cover all CodePress CMS features and functions.
This commit is contained in:
Edwin Noorlander 2025-11-22 18:12:34 +01:00
parent 561832161e
commit 04a9406f14
2 changed files with 232 additions and 22 deletions

View File

@ -19,6 +19,7 @@ CodePress is a lightweight, file-based Content Management System built with PHP
- PHP 8.4+ - PHP 8.4+
- Web server (Apache/Nginx) - Web server (Apache/Nginx)
- Modern web browser - Modern web browser
- Write permissions for content directory
### Installation ### Installation
1. Clone or download the CodePress files 1. Clone or download the CodePress files
@ -56,20 +57,43 @@ content/
``` ```
### Content Types ### Content Types
CodePress supports three content types: CodePress supports four content types:
#### Markdown (`.md`) #### Markdown (`.md`)
```markdown ```markdown
# Page Title # Page Title
This is the page content in **Markdown** format. This is page content in **Markdown** format with CommonMark extensions.
## Subsection ## Subsection
- List item 1 - [x] Task list item
- List item 2 - [ ] Another task
- **Bold** and *italic* text
- [Auto-linked pages](?page=another-page)
``` ```
#### PHP (`.php`)
```php
<?php
$title = "Dynamic Page";
?>
<h1><?php echo htmlspecialchars($title); ?></h1>
<p>This is dynamic content with PHP.</p>
```
#### HTML (`.html`)
```html
<h1>HTML Page</h1>
<p>This is static HTML content.</p>
```
#### Directory Listings
Directories automatically generate listings:
- File information (size, dates)
- Navigation to subdirectories
- Responsive file listing layout
#### PHP (`.php`) #### PHP (`.php`)
```php ```php
<?php <?php
@ -88,6 +112,18 @@ $title = "Dynamic Page";
### Automatic Linking ### Automatic Linking
CodePress automatically creates links to other pages when you mention page names in your content. CodePress automatically creates links to other pages when you mention page names in your content.
### Language Support
- **Browser detection**: Automatic language detection
- **URL switching**: `?lang=en` or `?lang=nl`
- **Language prefixes**: `en.page.md` and `nl.page.md`
- **Translation files**: `lang/en.php` and `lang/nl.php`
### Search Functionality
- **Full-text search**: Search through all content
- **Search URL**: `?search=query` for bookmarkable searches
- **Result highlighting**: Search terms highlighted in results
- **File and content search**: Searches both filenames and content
--- ---
## Templates {#templates} ## Templates {#templates}
@ -102,37 +138,109 @@ CodePress uses Mustache-compatible templates:
### Template Variables ### Template Variables
Available variables in templates: Available variables in templates:
#### **Site Info**
- `{{site_title}}` - Website title - `{{site_title}}` - Website title
- `{{page_title}}` - Current page title - `{{author_name}}` - Author name
- `{{content}}` - Page content - `{{author_website}}` - Author website
- `{{author_git}}` - Git repository link
#### **Page Info**
- `{{page_title}}` - Page title (filename without extension)
- `{{content}}` - Page content (HTML)
- `{{file_info}}` - File information (dates, size)
- `{{is_homepage}}` - Boolean: is this the homepage?
#### **Navigation**
- `{{menu}}` - Navigation menu - `{{menu}}` - Navigation menu
- `{{breadcrumb}}` - Breadcrumb navigation - `{{breadcrumb}}` - Breadcrumb navigation
- `{{homepage}}` - Homepage link
- `{{homepage_title}}` - Homepage title
#### **Theme**
- `{{header_color}}` - Header background color
- `{{header_font_color}}` - Header text color
- `{{navigation_color}}` - Navigation background color
- `{{navigation_font_color}}` - Navigation text color
#### **Language**
- `{{current_lang}}` - Current language (en/nl)
- `{{current_lang_upper}}` - Current language (EN/NL)
- `{{available_langs}}` - Available languages
- `{{t_*}}` - Translated strings (t_home, t_search, etc.)
#### **SEO**
- `{{seo_description}}` - Meta description
- `{{seo_keywords}}` - Meta keywords
#### **Features**
- `{{has_content}}` - Boolean: is content available?
- `{{show_site_link}}` - Boolean: show site link?
- `{{is_guide_page}}` - Boolean: is this the guide page?
--- ---
## Configuration {#configuration} ## Configuration {#configuration}
### Basic Settings ### Basic Settings
Edit `engine/core/config.php` for your website: Edit `config.json` in your project root:
```php ```json
$config = [ {
'site_title' => 'Your Website Name', "site_title": "Your Website Name",
'default_page' => 'home', // Default start page "content_dir": "content",
'content_dir' => __DIR__ . '/../../content', "templates_dir": "engine/templates",
'templates_dir' => __DIR__ . '/../templates' "default_page": "auto",
]; "language": {
"default": "en",
"available": ["en", "nl"]
},
"theme": {
"header_color": "#0a369d",
"header_font_color": "#ffffff",
"navigation_color": "#2754b4",
"navigation_font_color": "#ffffff"
},
"author": {
"name": "Your Name",
"website": "https://yourwebsite.com",
"git": "https://github.com/youruser/codepress"
},
"seo": {
"description": "Your website description",
"keywords": "cms, php, content management"
},
"features": {
"auto_link_pages": true,
"search_enabled": true,
"breadcrumbs_enabled": true
}
}
``` ```
### SEO Friendly URLs ### SEO Friendly URLs
CodePress automatically generates clean URLs: CodePress automatically generates clean URLs:
- `home.md``/home` - `home.md``?page=home`
- `blog/article.md``/blog/article` - `blog/article.md``?page=blog/article`
- `nl.page.md``?page=nl.page&lang=nl`
### Language Support
- **Browser detection**: Automatic language detection
- **URL switching**: `?lang=en` or `?lang=nl`
- **Language prefixes**: `en.page.md` and `nl.page.md`
- **Directory precedence**: Directories take precedence over files
### Search Functionality ### Search Functionality
The built-in search function searches through: The built-in search function searches through:
- File names - File names
- Content of Markdown/PHP/HTML files - Content of Markdown/PHP/HTML files
- Search URL: `?search=query` for bookmarkable searches
- Result highlighting and snippets
### Directory Listings
- **Auto-generation**: `?page=directory` shows directory contents
- **File information**: Creation/modification dates and sizes
- **Navigation**: Links to files and subdirectories
--- ---
@ -142,6 +250,15 @@ The built-in search function searches through:
- Use subdirectories for categories - Use subdirectories for categories
- Give each directory an `index.md` for an overview page - Give each directory an `index.md` for an overview page
- Keep file names short and descriptive - Keep file names short and descriptive
- Use language prefixes: `en.page.md` and `nl.page.md`
- Directory names take precedence over files with same name
### File Naming Conventions
- **Lowercase names**: Use lowercase for all files
- **No spaces**: Use hyphens (-) or underscores (_)
- **Language prefixes**: `en.` or `nl.` for multilingual content
- **Display names**: `file-name.md` displays as "File Name" in menus
- **Special cases**: `phpinfo` → "phpinfo", `ict` → "ICT"
### Content Optimization ### Content Optimization
- Use clear headings (H1, H2, H3) - Use clear headings (H1, H2, H3)

View File

@ -12,11 +12,15 @@ CodePress CMS is een lichtgewicht, file-based content management systeem gebouwd
- **Home knop** met icoon die linkt naar de ingestelde homepage - **Home knop** met icoon die linkt naar de ingestelde homepage
- **Automatische menu generatie** op basis van content structuur - **Automatische menu generatie** op basis van content structuur
- **Responsive design** voor mobiele apparaten - **Responsive design** voor mobiele apparaten
- **Breadcrumb navigatie** met home icoon en pad weergave
- **Active state marking** voor huidige pagina in menu
### 📄 **Content Types** ### 📄 **Content Types**
- **Markdown (.md)** - Met auto-linking tussen pagina's - **Markdown (.md)** - Met CommonMark ondersteuning en extensies (autolink, strikethrough, tables, task lists)
- **PHP (.php)** - Voor dynamische content en functionaliteit - **PHP (.php)** - Voor dynamische content en functionaliteit
- **HTML (.html)** - Voor statische HTML pagina's - **HTML (.html)** - Voor statische HTML pagina's
- **Directory listings** - Automatische generatie van directory overzichten
- **Language-specific content** - `nl.` en `en.` prefix voor meertalige content
- **Automatische template selectie** op basis van bestandstype - **Automatische template selectie** op basis van bestandstype
### 🔍 **Zoekfunctionaliteit** ### 🔍 **Zoekfunctionaliteit**
@ -24,13 +28,16 @@ CodePress CMS is een lichtgewicht, file-based content management systeem gebouwd
- **Resultaten met snippets** en highlighting - **Resultaten met snippets** en highlighting
- **Directe navigatie** naar gevonden pagina's - **Directe navigatie** naar gevonden pagina's
- **SEO-vriendelijke** zoekresultaten - **SEO-vriendelijke** zoekresultaten
- **Search URL**: `?search=zoekterm` voor bookmarkable searches
### 🧭 **Configuratie** ### 🧭 **Configuratie**
- **JSON configuratie** in project root (`config.json`) - **JSON configuratie** in project root (`config.json`)
- **Dynamische homepage** instelling of automatische detectie - **Dynamische homepage** instelling of automatische detectie
- **SEO instellingen** (description, keywords) - **SEO instellingen** (description, keywords)
- **Author informatie** met links naar website en Git - **Author informatie** met links naar website en Git
- **Thema configuratie** mogelijkheden - **Thema configuratie** met kleur instellingen
- **Language settings** voor meertalige content
- **Feature toggles** voor search, breadcrumbs, auto-linking
### 🎨 **Layout & Design** ### 🎨 **Layout & Design**
- **Flexbox layout** voor moderne, responsive structuur - **Flexbox layout** voor moderne, responsive structuur
@ -39,6 +46,8 @@ CodePress CMS is een lichtgewicht, file-based content management systeem gebouwd
- **Fixed footer** met file info en links - **Fixed footer** met file info en links
- **Bootstrap 5** styling en componenten - **Bootstrap 5** styling en componenten
- **Custom CSS** voor specifieke styling - **Custom CSS** voor specifieke styling
- **Mustache templates** met conditionals en partials
- **Semantic HTML5** structuur voor SEO
### 📱 **Responsive Features** ### 📱 **Responsive Features**
- **Mobile-first** aanpak - **Mobile-first** aanpak
@ -46,6 +55,13 @@ CodePress CMS is een lichtgewicht, file-based content management systeem gebouwd
- **Touch-friendly** dropdowns en navigatie - **Touch-friendly** dropdowns en navigatie
- **Adaptieve breedtes** voor verschillende schermgroottes - **Adaptieve breedtes** voor verschillende schermgroottes
### 🌍 **Language Support**
- **Browser language detection** op basis van Accept-Language header
- **URL language switching**: `?lang=nl` of `?lang=en`
- **Translation files**: `lang/nl.php` en `lang/en.php`
- **Language prefixes**: `nl.bestand.md` en `en.bestand.md`
- **Automatic language routing** voor meertalige content
## Installatie ## Installatie
1. **Upload bestanden** naar webserver 1. **Upload bestanden** naar webserver
@ -64,6 +80,16 @@ CodePress CMS is een lichtgewicht, file-based content management systeem gebouwd
"templates_dir": "engine/templates", "templates_dir": "engine/templates",
"default_page": "auto", "default_page": "auto",
"homepage": "welkom", "homepage": "welkom",
"language": {
"default": "nl",
"available": ["nl", "en"]
},
"theme": {
"header_color": "#0a369d",
"header_font_color": "#ffffff",
"navigation_color": "#2754b4",
"navigation_font_color": "#ffffff"
},
"author": { "author": {
"name": "Edwin Noorlander", "name": "Edwin Noorlander",
"website": "https://noorlander.info", "website": "https://noorlander.info",
@ -72,6 +98,11 @@ CodePress CMS is een lichtgewicht, file-based content management systeem gebouwd
"seo": { "seo": {
"description": "CodePress CMS - Lightweight file-based content management system", "description": "CodePress CMS - Lightweight file-based content management system",
"keywords": "cms, php, content management, file-based" "keywords": "cms, php, content management, file-based"
},
"features": {
"auto_link_pages": true,
"search_enabled": true,
"breadcrumbs_enabled": true
} }
} }
``` ```
@ -83,8 +114,12 @@ CodePress CMS is een lichtgewicht, file-based content management systeem gebouwd
- **`templates_dir`** - Map met template bestanden - **`templates_dir`** - Map met template bestanden
- **`default_page`** - Standaard pagina (`"auto"` voor automatische detectie) - **`default_page`** - Standaard pagina (`"auto"` voor automatische detectie)
- **`homepage`** - Specifieke homepage (`"auto"` voor automatische detectie) - **`homepage`** - Specifieke homepage (`"auto"` voor automatische detectie)
- **`language.default`** - Standaard taal
- **`language.available`** - Beschikbare talen
- **`theme.*`** - Kleur instellingen voor header en navigatie
- **`author`** - Auteur informatie met links - **`author`** - Auteur informatie met links
- **`seo`** - SEO instellingen - **`seo`** - SEO instellingen
- **`features.*`** - Feature toggles (search, breadcrumbs, auto-linking)
## Content Structuur ## Content Structuur
@ -109,6 +144,9 @@ content/
- **Geen spaties** - gebruik `-` of `_` als scheidingsteken - **Geen spaties** - gebruik `-` of `_` als scheidingsteken
- **Logische extensies** - `.md`, `.php`, `.html` - **Logische extensies** - `.md`, `.php`, `.html`
- **Unieke namen** - geen duplicaten binnen dezelfde map - **Unieke namen** - geen duplicaten binnen dezelfde map
- **Language prefixes** - `nl.bestand.md` en `en.bestand.md` voor meertalige content
- **Display names** - `bestands-naam` wordt automatisch "Bestands Naam" in menu's
- **Special cases** - `phpinfo` → "phpinfo", `ict` → "ICT"
## Templates ## Templates
@ -128,15 +166,70 @@ engine/templates/
### Template Variabelen ### Template Variabelen
#### **Site Info**
- **`{{site_title}}`** - Website titel - **`{{site_title}}`** - Website titel
- **`{{page_title}}`** - Pagina titel - **`{{author_name}}`** - Auteur naam
- **`{{author_website}}`** - Auteur website
- **`{{author_git}}`** - Git repository link
#### **Page Info**
- **`{{page_title}}`** - Pagina titel (bestandsnaam zonder extensie)
- **`{{content}}`** - Content (HTML) - **`{{content}}`** - Content (HTML)
- **`{{file_info}}`** - Bestandsinformatie (datum, grootte)
- **`{{is_homepage}}`** - Boolean: is dit de homepage?
#### **Navigation**
- **`{{menu}}`** - Navigatie menu - **`{{menu}}`** - Navigatie menu
- **`{{breadcrumb}}`** - Breadcrumb navigatie - **`{{breadcrumb}}`** - Breadcrumb navigatie
- **`{{search_query}}`** - Zoekopdracht
- **`{{homepage}}`** - Homepage link - **`{{homepage}}`** - Homepage link
- **`{{author_*}}`** - Auteur informatie - **`{{homepage_title}}`** - Homepage titel
- **`{{seo_*}}`** - SEO informatie
#### **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)
- **`{{available_langs}}`** - Beschikbare talen
- **`{{t_*}}`** - Vertaalde strings (t_home, t_search, etc.)
#### **SEO**
- **`{{seo_description}}`** - Meta description
- **`{{seo_keywords}}`** - Meta keywords
#### **Features**
- **`{{has_content}}`** - Boolean: is er content beschikbaar?
- **`{{show_site_link}}`** - Boolean: toon site link?
- **`{{is_guide_page}}`** - Boolean: is dit de handleiding pagina?
## URL Structuur
### Basis URLs
- **Home**: `/` of `?page=home`
- **Pagina**: `?page=map/pagina`
- **Zoeken**: `?search=zoekterm`
- **Handleiding**: `?guide`
- **Language**: `?lang=nl` of `?lang=en`
### File Extensions
Bestandsextensies worden automatisch gedetecteerd:
- `pagina.md``?page=pagina`
- `pagina.php``?page=pagina`
- `pagina.html``?page=pagina`
### Language Support
- **Browser detection**: Automatische taal detectie
- **URL switching**: `?page=nl.bestand&lang=nl`
- **Language prefixes**: `nl.bestand.md` en `en.bestand.md`
- **Directory precedence**: Directories hebben voorrang op bestanden
### Directory Listings
- **Auto-generation**: `?page=map` toont directory inhoud
- **File info**: Creatie/modificatie datums en groottes
- **Navigation**: Links naar bestanden en submappen
## SEO Optimalisatie ## SEO Optimalisatie