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
+8 -2
View File
@@ -17,6 +17,8 @@ $footer = SiteDesign::footer($site);
$nav = $header['links'];
$contact = $header['button'];
$theme = $page['theme'] ?? '';
$showHeader = $page['visibility']['header'] ?? true;
$showFooter = $page['visibility']['footer'] ?? true;
?>
<!doctype html>
<html lang="zh-CN" data-type="<?= $e($kind) ?>" data-buttons="solid" data-motion="on">
@@ -53,7 +55,8 @@ $theme = $page['theme'] ?? '';
</head>
<body<?= $kind === 'service' ? ' class="copyright-service"' : '' ?>>
<a class="skip-link" href="#main-content">跳到内容</a>
<header class="masthead">
<?php if ($showHeader || !empty($canvas)): ?>
<header class="masthead"<?= $showHeader ? '' : ' hidden' ?>>
<div class="wrap masthead-inner">
<a class="wordmark" href="/" aria-label="来笙 Laysense 首页">
<?php if ($header['logo'] !== ''): ?>
@@ -77,7 +80,10 @@ $theme = $page['theme'] ?? '';
<?php endif ?>
</div>
</header>
<?php endif ?>
<main id="main-content"<?= $theme !== '' ? ' class="page-theme theme-' . $e($theme) . '"' : '' ?> tabindex="-1"><?= $content ?></main>
<?= View::fragment('footer', ['footer' => $footer]) ?>
<?php if ($showFooter || !empty($canvas)): ?>
<?= View::fragment('footer', ['footer' => $footer, 'hideFooter' => !$showFooter]) ?>
<?php endif ?>
</body>
</html>