CodePress/guide/en.codepress.md
Edwin Noorlander bf2ee9c212 Fix internal markdown links and auto-linking language persistence
- Add language parameter to autoLinkPageTitles() method
- Fix internal links to include current language (?page=x&lang=en)
- Remove broken header ID syntax from English guide
- Ensure all auto-generated internal links maintain language context
- Internal page links now work correctly across language switches
2025-11-22 16:28:19 +01:00

171 lines
3.7 KiB
Markdown

# CodePress CMS Guide
## Welcome to CodePress CMS
CodePress is a lightweight, file-based Content Management System built with PHP and Bootstrap.
### Table of Contents
1. [Getting Started](#getting-started)
2. [Content Management](#content-management)
3. [Templates](#templates)
4. [Configuration](#configuration)
---
## Getting Started
### Requirements
- PHP 8.4+
- Web server (Apache/Nginx)
- Modern web browser
### Installation
1. Clone or download the CodePress files
2. Upload to your web server
3. Make sure the `content/` directory is writable
4. Navigate to your website in the browser
### Basic Configuration
The most important settings are in `engine/core/config.php`:
```php
$config = [
'site_title' => 'My Website',
'default_page' => 'home',
'content_dir' => __DIR__ . '/../../content',
'templates_dir' => __DIR__ . '/../templates'
];
```
---
## Content Management {#content-management}
### File Structure
```
content/
├── home.md # Home page
├── blog/
│ ├── index.md # Blog overview
│ ├── article-1.md # Blog article
│ └── category/
│ └── article.md # Article in category
└── about-us/
└── info.md # About us page
```
### Content Types
CodePress supports three content types:
#### Markdown (`.md`)
```markdown
# Page Title
This is the page content in **Markdown** format.
## Subsection
- List item 1
- List item 2
```
#### PHP (`.php`)
```php
<?php
$title = "Dynamic Page";
?>
<h1><?php echo $title; ?></h1>
<p>This is dynamic content with PHP.</p>
```
#### HTML (`.html`)
```html
<h1>HTML Page</h1>
<p>This is static HTML content.</p>
```
### Automatic Linking
CodePress automatically creates links to other pages when you mention page names in your content.
---
## Templates {#templates}
### Template Structure
CodePress uses Mustache-compatible templates:
- `layout.mustache` - Main template
- `assets/header.mustache` - Header component
- `assets/sidebar.mustache` - Sidebar navigation
- `assets/footer.mustache` - Footer component
### Template Variables
Available variables in templates:
- `{{site_title}}` - Website title
- `{{page_title}}` - Current page title
- `{{content}}` - Page content
- `{{menu}}` - Navigation menu
- `{{breadcrumb}}` - Breadcrumb navigation
---
## Configuration {#configuration}
### Basic Settings
Edit `engine/core/config.php` for your website:
```php
$config = [
'site_title' => 'Your Website Name',
'default_page' => 'home', // Default start page
'content_dir' => __DIR__ . '/../../content',
'templates_dir' => __DIR__ . '/../templates'
];
```
### SEO Friendly URLs
CodePress automatically generates clean URLs:
- `home.md``/home`
- `blog/article.md``/blog/article`
### Search Functionality
The built-in search function searches through:
- File names
- Content of Markdown/PHP/HTML files
---
## Tips and Tricks
### Page Organization
- Use subdirectories for categories
- Give each directory an `index.md` for an overview page
- Keep file names short and descriptive
### Content Optimization
- Use clear headings (H1, H2, H3)
- Add descriptive meta information
- Use internal links for better navigation
### Security
- Keep your CodePress installation updated
- Restrict write permissions on the `content/` directory
- Use HTTPS when possible
---
## Support
### Troubleshooting
- **Empty pages**: Check file permissions
- **Template errors**: Verify template syntax
- **404 errors**: Check file names and paths
### More Information
- Documentation: [CodePress GitHub](https://git.noorlander.info/E.Noorlander/CodePress.git)
- Issues and feature requests: GitHub Issues
---
*This guide is part of CodePress CMS and is automatically displayed when no content is available.*