Expand page templates and configure page visibility

This commit is contained in:
2026-11-22 12:54:01 +08:00
parent 931d333ca7
commit f23c3b95ba
27 changed files with 293 additions and 44 deletions
+3 -2
View File
@@ -41,6 +41,7 @@ final class SiteController
{
$slug = $page['slug'];
$isHome = $slug === 'home';
$showHero = $page['visibility']['hero'] ?? true;
$categories = $repo->categories();
foreach ($page['sections'] as &$section) {
if (!$section['feed']) {
@@ -75,8 +76,8 @@ final class SiteController
'path' => $isHome ? '/' : '/' . $slug,
'title' => $page['title'],
'description' => $page['description'],
'socialImage' => $page['image'],
'socialAlt' => $page['alt'],
'socialImage' => $showHero ? $page['image'] : '',
'socialAlt' => $showHero ? $page['alt'] : '',
'previewMode' => $preview, 'canvas' => $preview && $canvas, 'noindex' => $preview,
]);
}