Fix guide template variable replacement and enhance documentation

- Fix template variable replacement in guide pages by removing {{}} brackets
- Escape code blocks in guide markdown to prevent template processing
- Completely rewrite guide documentation with comprehensive CMS features
- Add bilingual guide support (English/Dutch) with detailed examples
- Enhance CodePressCMS core with improved guide page handling
- Update template system with better layout and footer components
- Improve language files with additional translations
- Update configuration with enhanced theme and language settings

Resolves issue where guide pages were showing replaced template variables
instead of displaying them as documentation examples.
This commit is contained in:
2025-11-26 16:50:49 +01:00
parent f5ac28a74e
commit 9c5a43c5ce
17 changed files with 1684 additions and 462 deletions

View File

@@ -37,6 +37,16 @@ class SimpleTemplate {
// Handle partial includes first ({{>partial}})
$template = preg_replace_callback('/{{>([^}]+)}}/', [$this, 'replacePartial'], $template);
// Handle equal conditionals first
$template = preg_replace_callback('/{{#equal\s+(\w+)\s+["\']([^"\']+)["\']}}(.*?){{\/equal}}/s', function($matches) {
$key = $matches[1];
$expectedValue = $matches[2];
$content = $matches[3];
$actualValue = $this->data[$key] ?? '';
return ($actualValue === $expectedValue) ? $content : '';
}, $template);
// Handle conditional blocks
foreach ($this->data as $key => $value) {
if (is_array($value)) {