404 - Not Found
The requested file could not be found.
", 404);
}
@@ -129,6 +139,7 @@ function renderMultipleFiles(Context $ctx, array $files, string $pageDir): void
$pageMetadata = loadMetadata($pageDir);
+ // Load page-level plugins
getPluginManager()->loadPagePlugins($pageMetadata);
$navigation = $ctx->navigation;
@@ -136,10 +147,12 @@ function renderMultipleFiles(Context $ctx, array $files, string $pageDir): void
$pageTitle = $pageMetadata['title'] ?? null;
$metaDescription = extractMetaDescription($pageDir, $pageMetadata);
+ // Check for page-specific CSS
$pageCss = findPageCss($pageDir, $ctx->contentDir);
$pageCssUrl = $pageCss['url'] ?? null;
$pageCssHash = $pageCss['hash'] ?? null;
+ // Check for cover image
$coverImage = findCoverImage($pageDir);
$socialImageUrl = null;
if ($coverImage) {
@@ -148,6 +161,7 @@ function renderMultipleFiles(Context $ctx, array $files, string $pageDir): void
$socialImageUrl = '/' . ($relativePath ? $relativePath . '/' : '') . $coverImage;
}
+ // Let plugins add template variables
$templateVars = Hooks::apply(Hook::TEMPLATE_VARS, [
'content' => $content,
'navigation' => $navigation,
@@ -161,6 +175,7 @@ function renderMultipleFiles(Context $ctx, array $files, string $pageDir): void
extract($templateVars);
+ // Wrap content with page template
ob_start();
require $ctx->templates->page;
$wrappedContent = ob_get_clean();