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
This commit is contained in:
Edwin Noorlander 2025-11-22 16:28:19 +01:00
parent bea9cdfb0c
commit bf2ee9c212
2 changed files with 4 additions and 4 deletions

View File

@ -434,7 +434,7 @@ class CodePressCMS {
return $text; // Don't link existing links, current page title, or H1 headings
}
return '<a href="?page=' . $pagePath . '" class="auto-link" title="Ga naar ' . htmlspecialchars($pageTitle) . '">' . $text . '</a>';
return '<a href="?page=' . $pagePath . '&lang=' . $this->currentLanguage . '" class="auto-link" title="Ga naar ' . htmlspecialchars($pageTitle) . '">' . $text . '</a>';
};
$content = preg_replace_callback($pattern, $replacement, $content);

View File

@ -40,7 +40,7 @@ $config = [
---
## Content Management
## Content Management {#content-management}
### File Structure
```
@ -90,7 +90,7 @@ CodePress automatically creates links to other pages when you mention page names
---
## Templates
## Templates {#templates}
### Template Structure
CodePress uses Mustache-compatible templates:
@ -110,7 +110,7 @@ Available variables in templates:
---
## Configuration
## Configuration {#configuration}
### Basic Settings
Edit `engine/core/config.php` for your website: