- 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
157 lines
3.9 KiB
Markdown
157 lines
3.9 KiB
Markdown
# CodePress CMS
|
|
|
|
A lightweight, file-based Content Management System built with PHP and Bootstrap.
|
|
|
|
## Overview
|
|
|
|
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.
|
|
|
|
## Features
|
|
|
|
### 🎯 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
|
|
|
|
### 🔧 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
|
|
|
|
## Quick Start
|
|
|
|
1. **Requirements**: PHP 8.4+
|
|
2. **Installation**:
|
|
```bash
|
|
git clone https://git.noorlander.info/E.Noorlander/CodePress.git
|
|
cd CodePress
|
|
```
|
|
3. **Start server**:
|
|
```bash
|
|
php -S localhost:8000 -t public
|
|
```
|
|
4. **Visit**: `http://localhost:8000`
|
|
|
|
## Project Structure
|
|
|
|
```
|
|
codepress/
|
|
├── 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
|
|
```
|
|
|
|
## Security
|
|
|
|
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**
|
|
|
|
## Content Management
|
|
|
|
### 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
|
|
|
|
---
|
|
|
|
*Built with ❤️ and PHP* |