Clean main branch for CodePress CMS
- Removed personal blog content from main branch - Added comprehensive CodePress documentation in home.md - Updated README.md for general CodePress usage - Main branch now contains clean CMS framework - Ready for general CodePress distribution
This commit is contained in:
parent
bd0f6ecbfc
commit
e392bb8d09
191
README.md
191
README.md
@ -1,80 +1,157 @@
|
|||||||
# CodePress CMS
|
# CodePress CMS
|
||||||
|
|
||||||
Een lichtgewicht PHP Content Management System gebouwd met Bootstrap en Mustache-style templating.
|
A lightweight, file-based Content Management System built with PHP and Bootstrap.
|
||||||
|
|
||||||
## Project Achtergrond
|
## Overview
|
||||||
|
|
||||||
Dit project is ontwikkeld in opdracht van **Edwin Noorlander** als een demonstratie van een modern, file-based CMS. De opdracht was om een eenvoudig maar krachtig systeem te creëren dat content beheert via bestanden in plaats van een database.
|
CodePress is a modern, secure CMS that manages content through files instead of a database. It's designed for simplicity, flexibility, and ease of use while maintaining powerful features for content management.
|
||||||
|
|
||||||
## Ontwikkelingsproces
|
## Features
|
||||||
|
|
||||||
### Technische Keuzes
|
### 🎯 Core Features
|
||||||
- **PHP 8.4+** voor server-side logica
|
- **File-based content** - No database required
|
||||||
- **Bootstrap 5** voor responsive design
|
- **Multi-format support** - Markdown, PHP, HTML files
|
||||||
- **File-based content storage** voor eenvoudig beheer
|
- **Dynamic navigation** - Auto-generated from directory structure
|
||||||
- **Markdown en PHP support** voor flexibele content
|
- **Search functionality** - Full-text search with snippets
|
||||||
- **SVG iconen** voor scherpe graphics
|
- **Breadcrumb navigation** - Clear page hierarchy
|
||||||
|
- **Responsive design** - Works on all devices
|
||||||
|
|
||||||
### Iteratieve Ontwikkeling
|
### 🔧 Advanced Features
|
||||||
Het project is stapsgewijs opgebouwd met continue feedback:
|
- **Collapsible folders** - Accordion-style navigation
|
||||||
|
- **WCAG compliant** - Accessible design with proper contrast
|
||||||
|
- **File metadata** - Creation and modification dates in footer
|
||||||
|
- **Progressive styling** - Visual hierarchy with nested levels
|
||||||
|
- **Security** - Protected PHP files and sensitive directories
|
||||||
|
|
||||||
1. **Basis structuur** - Configuratie en templating systeem
|
## Quick Start
|
||||||
2. **Content parsing** - Markdown, PHP en HTML ondersteuning
|
|
||||||
3. **Navigatie** - Dynamische menu generatie met hiërarchie
|
|
||||||
4. **Zoekfunctionaliteit** - Volledige tekst doorzoeking van content
|
|
||||||
5. **UI/UX verbeteringen** - Progressieve achtergrondkleuren, collapsible mappen
|
|
||||||
6. **Toegankelijkheid** - WCAG compliant contrast en navigatie
|
|
||||||
7. **Footer met metadata** - Bestandsinformatie en aanmaak/bewerkingsdatums
|
|
||||||
|
|
||||||
### Kernfeatures
|
1. **Requirements**: PHP 8.4+
|
||||||
- ✅ **Multi-format content**: Markdown, PHP, HTML bestanden
|
2. **Installation**:
|
||||||
- ✅ **Dynamische navigatie**: Automatische menu generatie uit directory structuur
|
|
||||||
- ✅ **Zoekfunctie**: Volledige tekst doorzoeking met snippets
|
|
||||||
- ✅ **Kruimelpad**: Navigatie pad indicatie
|
|
||||||
- ✅ **Collapsible mappen**: Accordion-style navigatie
|
|
||||||
- ✅ **WCAG compliant**: Goede contrast ratio's en toegankelijkheid
|
|
||||||
- ✅ **Responsive design**: Werkt op alle schermformaten
|
|
||||||
- ✅ **File metadata**: Aanmaak- en bewerkingsdatums in footer
|
|
||||||
|
|
||||||
## Installatie
|
|
||||||
|
|
||||||
1. Zorg dat PHP 8.4+ geïnstalleerd is
|
|
||||||
2. Clone dit repository
|
|
||||||
3. Start de development server:
|
|
||||||
```bash
|
```bash
|
||||||
php -S localhost:8000
|
git clone https://git.noorlander.info/E.Noorlander/CodePress.git
|
||||||
|
cd CodePress
|
||||||
```
|
```
|
||||||
4. Bezoek `http://localhost:8000` in je browser
|
3. **Start server**:
|
||||||
|
```bash
|
||||||
|
php -S localhost:8000 -t public
|
||||||
|
```
|
||||||
|
4. **Visit**: `http://localhost:8000`
|
||||||
|
|
||||||
## Content Beheer
|
## Project Structure
|
||||||
|
|
||||||
- Plaats content bestanden in de `content/` map
|
|
||||||
- Gebruik `.md`, `.php` of `.html` extensies
|
|
||||||
- De menu structuur volgt automatisch de directory hiërarchie
|
|
||||||
- Submappen worden genest in de navigatie weergegeven
|
|
||||||
|
|
||||||
## Project Structuur
|
|
||||||
|
|
||||||
```
|
```
|
||||||
codepress/
|
codepress/
|
||||||
├── assets/ # Iconen en static files
|
├── public/ # Web-accessible directory
|
||||||
├── content/ # Content bestanden (MD/PHP/HTML)
|
│ ├── content/ # Content files (MD/PHP/HTML)
|
||||||
├── templates/ # HTML templates
|
│ ├── assets/ # Static assets (images, icons)
|
||||||
├── config.php # Site configuratie
|
│ └── .htaccess # Security and routing
|
||||||
├── index.php # Hoofd applicatie logica
|
├── templates/ # HTML templates
|
||||||
└── README.md # Deze documentatie
|
├── config.php # Site configuration
|
||||||
|
├── index.php # Main application logic
|
||||||
|
├── .htaccess # Root security
|
||||||
|
└── README.md # This documentation
|
||||||
```
|
```
|
||||||
|
|
||||||
## Opdrachtgever
|
## Security
|
||||||
|
|
||||||
**Edwin Noorlander**
|
CodePress includes built-in security features:
|
||||||
- Persoonlijke blog: [https://noorlander.info](https://noorlander.info)
|
- **.htaccess protection** for sensitive files
|
||||||
- Git repository: [https://git.noorlander.info/E.Noorlander/CodePress.git](https://git.noorlander.info/E.Noorlander/CodePress.git)
|
- **PHP file blocking** in content directory
|
||||||
|
- **Security headers** for XSS protection
|
||||||
|
- **Directory access control**
|
||||||
|
- **Public directory isolation**
|
||||||
|
|
||||||
## Licentie
|
## Content Management
|
||||||
|
|
||||||
Dit project is ontwikkeld als onderdeel van een opdracht en valt onder de voorwaarden zoals overeengekomen met de opdrachtgever.
|
### Supported File Types
|
||||||
|
|
||||||
|
#### Markdown (.md)
|
||||||
|
```markdown
|
||||||
|
# Page Title
|
||||||
|
|
||||||
|
Content with **bold** and *italic* text.
|
||||||
|
|
||||||
|
[Link to page](?page=other/page)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### PHP (.php)
|
||||||
|
```php
|
||||||
|
<?php
|
||||||
|
$title = "Dynamic Page";
|
||||||
|
$date = date('Y-m-d');
|
||||||
|
?>
|
||||||
|
|
||||||
|
<h1><?php echo $title; ?></h1>
|
||||||
|
<p>Date: <?php echo $date; ?></p>
|
||||||
|
```
|
||||||
|
|
||||||
|
#### HTML (.html)
|
||||||
|
```html
|
||||||
|
<h1>Static HTML Page</h1>
|
||||||
|
<div class="alert alert-info">
|
||||||
|
Custom HTML content
|
||||||
|
</div>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Directory Structure
|
||||||
|
```
|
||||||
|
public/content/
|
||||||
|
├── home.md # Homepage
|
||||||
|
├── about/
|
||||||
|
│ └── company.md # About page
|
||||||
|
├── blog/
|
||||||
|
│ ├── tech/
|
||||||
|
│ │ └── post.md # Blog post
|
||||||
|
│ └── index.md # Blog overview
|
||||||
|
└── projects/
|
||||||
|
└── web-design.md # Project page
|
||||||
|
```
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
Edit `config.php` to customize:
|
||||||
|
|
||||||
|
```php
|
||||||
|
return [
|
||||||
|
'site_title' => 'Your Site Name',
|
||||||
|
'site_description' => 'Your site description',
|
||||||
|
'content_dir' => __DIR__ . '/public/content',
|
||||||
|
'default_page' => 'home',
|
||||||
|
'markdown_enabled' => true,
|
||||||
|
'php_enabled' => true,
|
||||||
|
];
|
||||||
|
```
|
||||||
|
|
||||||
|
## Branches
|
||||||
|
|
||||||
|
- **main**: Clean CodePress CMS with documentation
|
||||||
|
- **e.noorlander**: Personal blog content and customizations
|
||||||
|
- **development**: Active development branch
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
### Adding Features
|
||||||
|
1. Create feature branch from `development`
|
||||||
|
2. Implement changes
|
||||||
|
3. Test thoroughly
|
||||||
|
4. Submit merge request
|
||||||
|
|
||||||
|
### Contributing
|
||||||
|
- Follow PSR-12 coding standards
|
||||||
|
- Test security implications
|
||||||
|
- Update documentation
|
||||||
|
- Maintain backward compatibility
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
This project is developed for specific use cases. Contact the maintainer for licensing information.
|
||||||
|
|
||||||
|
## Support
|
||||||
|
|
||||||
|
- **Documentation**: See `public/content/home.md`
|
||||||
|
- **Issues**: Report on GitLab
|
||||||
|
- **Community**: Join discussions
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
*Gebouwd met ❤️ en PHP*
|
*Built with ❤️ and PHP*
|
||||||
172
public/content/home.md
Normal file
172
public/content/home.md
Normal file
@ -0,0 +1,172 @@
|
|||||||
|
# Welcome to CodePress CMS
|
||||||
|
|
||||||
|
CodePress is a lightweight, file-based Content Management System built with PHP and Bootstrap. This guide will help you get started with creating your own content structure.
|
||||||
|
|
||||||
|
## Quick Start
|
||||||
|
|
||||||
|
1. **Create your content structure** in `public/content/`
|
||||||
|
2. **Use Markdown (.md), PHP (.php), or HTML (.html) files**
|
||||||
|
3. **Navigate** using the automatically generated menu
|
||||||
|
4. **Search** through your content with the built-in search functionality
|
||||||
|
|
||||||
|
## Content Structure
|
||||||
|
|
||||||
|
### Basic Structure
|
||||||
|
```
|
||||||
|
public/content/
|
||||||
|
├── home.md # Homepage
|
||||||
|
├── about/
|
||||||
|
│ └── company.md # About page
|
||||||
|
├── blog/
|
||||||
|
│ ├── index.md # Blog overview
|
||||||
|
│ ├── tech/
|
||||||
|
│ │ ├── first-post.md
|
||||||
|
│ │ └── second-post.md
|
||||||
|
│ └── personal/
|
||||||
|
│ └── my-story.md
|
||||||
|
└── projects/
|
||||||
|
├── web-design.md
|
||||||
|
└── mobile-app.md
|
||||||
|
```
|
||||||
|
|
||||||
|
### File Types Supported
|
||||||
|
|
||||||
|
#### Markdown Files (.md)
|
||||||
|
```markdown
|
||||||
|
# Page Title
|
||||||
|
|
||||||
|
This is the content of your page.
|
||||||
|
|
||||||
|
## Subheading
|
||||||
|
|
||||||
|
**Bold text** and *italic text* are supported.
|
||||||
|
|
||||||
|
[Link to other page](?page=blog/tech/first-post)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### PHP Files (.php)
|
||||||
|
```php
|
||||||
|
<?php
|
||||||
|
$title = "Dynamic Page";
|
||||||
|
$currentTime = date('Y-m-d H:i:s');
|
||||||
|
?>
|
||||||
|
|
||||||
|
<h1>Dynamic Content</h1>
|
||||||
|
<p>Current time: <?php echo $currentTime; ?></p>
|
||||||
|
```
|
||||||
|
|
||||||
|
#### HTML Files (.html)
|
||||||
|
```html
|
||||||
|
<h1>Static HTML Page</h1>
|
||||||
|
<p>This is a static HTML page with full control over the markup.</p>
|
||||||
|
|
||||||
|
<div class="alert alert-info">
|
||||||
|
Custom HTML content here
|
||||||
|
</div>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
### 🎯 Core Features
|
||||||
|
- **File-based content** - No database required
|
||||||
|
- **Multi-format support** - Markdown, PHP, HTML
|
||||||
|
- **Dynamic navigation** - Auto-generated from directory structure
|
||||||
|
- **Search functionality** - Full-text search with snippets
|
||||||
|
- **Breadcrumb navigation** - Clear page hierarchy
|
||||||
|
- **Responsive design** - Works on all devices
|
||||||
|
|
||||||
|
### 🔧 Advanced Features
|
||||||
|
- **Collapsible folders** - Accordion-style navigation
|
||||||
|
- **WCAG compliant** - Accessible design with proper contrast
|
||||||
|
- **File metadata** - Creation and modification dates in footer
|
||||||
|
- **Progressive styling** - Visual hierarchy with nested levels
|
||||||
|
- **Security** - Protected PHP files and sensitive directories
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
Edit `config.php` to customize your CMS:
|
||||||
|
|
||||||
|
```php
|
||||||
|
return [
|
||||||
|
'site_title' => 'Your Site Name',
|
||||||
|
'site_description' => 'Your site description',
|
||||||
|
'content_dir' => __DIR__ . '/public/content',
|
||||||
|
'default_page' => 'home',
|
||||||
|
'markdown_enabled' => true,
|
||||||
|
'php_enabled' => true,
|
||||||
|
];
|
||||||
|
```
|
||||||
|
|
||||||
|
## Navigation
|
||||||
|
|
||||||
|
The navigation is automatically generated from your directory structure:
|
||||||
|
|
||||||
|
- **Folders** become collapsible sections
|
||||||
|
- **Files** become menu items
|
||||||
|
- **Empty folders** are shown as disabled
|
||||||
|
- **Active pages** are highlighted
|
||||||
|
- **Nested structure** supports unlimited depth
|
||||||
|
|
||||||
|
## Search
|
||||||
|
|
||||||
|
The built-in search functionality:
|
||||||
|
- Searches through all content files
|
||||||
|
- Shows matching snippets
|
||||||
|
- Highlights file paths
|
||||||
|
- Supports title and content matching
|
||||||
|
|
||||||
|
## Security
|
||||||
|
|
||||||
|
CodePress includes built-in security:
|
||||||
|
- **.htaccess protection** for sensitive files
|
||||||
|
- **PHP file blocking** in content directory
|
||||||
|
- **Security headers** for XSS protection
|
||||||
|
- **Directory access control**
|
||||||
|
|
||||||
|
## Best Practices
|
||||||
|
|
||||||
|
### Content Organization
|
||||||
|
- Use descriptive folder names
|
||||||
|
- Keep file names simple and URL-friendly
|
||||||
|
- Organize content logically by topic
|
||||||
|
- Use consistent naming conventions
|
||||||
|
|
||||||
|
### File Types
|
||||||
|
- Use **Markdown** for simple content pages
|
||||||
|
- Use **PHP** for dynamic content with server-side logic
|
||||||
|
- Use **HTML** for complex layouts or static pages
|
||||||
|
|
||||||
|
### SEO Considerations
|
||||||
|
- Use descriptive page titles (first H1 in content)
|
||||||
|
- Create meaningful folder structures
|
||||||
|
- Use internal links between related content
|
||||||
|
- Keep content updated regularly
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
### Common Issues
|
||||||
|
|
||||||
|
**Content not showing?**
|
||||||
|
- Check file permissions
|
||||||
|
- Verify file extensions (.md, .php, .html)
|
||||||
|
- Check config.php paths
|
||||||
|
|
||||||
|
**Links not working?**
|
||||||
|
- Ensure correct URL format: `?page=path/to/file`
|
||||||
|
- Check file exists in content directory
|
||||||
|
- Verify case sensitivity
|
||||||
|
|
||||||
|
**Search not finding content?**
|
||||||
|
- Check file encoding (UTF-8 recommended)
|
||||||
|
- Verify content is not empty
|
||||||
|
- Check search query spelling
|
||||||
|
|
||||||
|
## Getting Help
|
||||||
|
|
||||||
|
- **Documentation**: Check this guide first
|
||||||
|
- **Issues**: Report bugs on GitLab
|
||||||
|
- **Community**: Join our discussions
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Happy content management with CodePress!** 🚀
|
||||||
Loading…
x
Reference in New Issue
Block a user