diff --git a/README.md b/README.md index ae85ccb..1e69b4c 100644 --- a/README.md +++ b/README.md @@ -1,80 +1,157 @@ # 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 -- **PHP 8.4+** voor server-side logica -- **Bootstrap 5** voor responsive design -- **File-based content storage** voor eenvoudig beheer -- **Markdown en PHP support** voor flexibele content -- **SVG iconen** voor scherpe graphics +### 🎯 Core Features +- **File-based content** - No database required +- **Multi-format support** - Markdown, PHP, HTML files +- **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 -### Iteratieve Ontwikkeling -Het project is stapsgewijs opgebouwd met continue feedback: +### πŸ”§ 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 -1. **Basis structuur** - Configuratie en templating systeem -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 +## Quick Start -### Kernfeatures -- βœ… **Multi-format content**: Markdown, PHP, HTML bestanden -- βœ… **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: +1. **Requirements**: PHP 8.4+ +2. **Installation**: ```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 - -- 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 +## Project Structure ``` codepress/ -β”œβ”€β”€ assets/ # Iconen en static files -β”œβ”€β”€ content/ # Content bestanden (MD/PHP/HTML) -β”œβ”€β”€ templates/ # HTML templates -β”œβ”€β”€ config.php # Site configuratie -β”œβ”€β”€ index.php # Hoofd applicatie logica -└── README.md # Deze documentatie +β”œβ”€β”€ public/ # Web-accessible directory +β”‚ β”œβ”€β”€ content/ # Content files (MD/PHP/HTML) +β”‚ β”œβ”€β”€ assets/ # Static assets (images, icons) +β”‚ └── .htaccess # Security and routing +β”œβ”€β”€ templates/ # HTML templates +β”œβ”€β”€ config.php # Site configuration +β”œβ”€β”€ index.php # Main application logic +β”œβ”€β”€ .htaccess # Root security +└── README.md # This documentation ``` -## Opdrachtgever +## Security -**Edwin Noorlander** -- Persoonlijke blog: [https://noorlander.info](https://noorlander.info) -- Git repository: [https://git.noorlander.info/E.Noorlander/CodePress.git](https://git.noorlander.info/E.Noorlander/CodePress.git) +CodePress includes built-in security features: +- **.htaccess protection** for sensitive files +- **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 + + +

+

Date:

+``` + +#### HTML (.html) +```html +

Static HTML Page

+
+ Custom HTML content +
+``` + +### 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* \ No newline at end of file +*Built with ❀️ and PHP* \ No newline at end of file diff --git a/public/content/home.md b/public/content/home.md new file mode 100644 index 0000000..4780d3f --- /dev/null +++ b/public/content/home.md @@ -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 + + +

Dynamic Content

+

Current time:

+``` + +#### HTML Files (.html) +```html +

Static HTML Page

+

This is a static HTML page with full control over the markup.

+ +
+ Custom HTML content here +
+``` + +## 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!** πŸš€ \ No newline at end of file