Add plugin system and improve language handling

Add global and page-level plugin support Implement language-aware
content filtering Add month translations to language files Refactor date
formatting to use translations Move translation loading to plugin system
Improve content availability checks
This commit is contained in:
Ruben 2025-11-11 23:36:53 +01:00
parent 875408a27c
commit 24ee209e17
9 changed files with 196 additions and 30 deletions

View file

@ -56,6 +56,10 @@ function renderFile(Context $ctx, string $filePath): void {
$pageDir = dirname($realPath);
$pageMetadata = loadMetadata($pageDir, $ctx->currentLang, $ctx->defaultLang);
// Load page-level plugins
getPluginManager()->loadPagePlugins($pageMetadata);
$pageTitle = $pageMetadata['title'] ?? null;
$metaDescription = extractMetaDescription($pageDir, $pageMetadata, $ctx->currentLang, $ctx->defaultLang);
@ -108,6 +112,10 @@ function renderMultipleFiles(Context $ctx, array $filePaths, string $pageDir): v
$translations = $ctx->translations;
$pageMetadata = loadMetadata($pageDir, $ctx->currentLang, $ctx->defaultLang);
// Load page-level plugins
getPluginManager()->loadPagePlugins($pageMetadata);
$pageTitle = $pageMetadata['title'] ?? null;
$metaDescription = extractMetaDescription($pageDir, $pageMetadata, $ctx->currentLang, $ctx->defaultLang);