Add page-specific CSS support

Add helper function to find page-specific CSS files Add CSS loading to
base template Update rendering functions to include page CSS Update
router to include page CSS for static pages
This commit is contained in:
Ruben 2025-11-03 23:04:16 +01:00
parent 0b84615bf9
commit 6879fad5fb
7 changed files with 110 additions and 0 deletions

View file

@ -136,6 +136,11 @@ switch ($parsedPath['type']) {
$translations = $ctx->translations;
$pageTitle = $metadata['title'] ?? null;
$metaDescription = extractMetaDescription($dir, $metadata, $ctx->currentLang, $ctx->defaultLang);
// Check for page-specific CSS
$pageCss = findPageCss($dir, $ctx->contentDir);
$pageCssUrl = $pageCss['url'] ?? null;
$pageCssHash = $pageCss['hash'] ?? null;
include $ctx->templates->base;
exit;