Edit shared headers and footers as page types

This commit is contained in:
2026-11-23 20:58:42 +08:00
parent 636788b65c
commit 9d386dd39c
40 changed files with 725 additions and 937 deletions
+3 -20
View File
@@ -1,18 +1,5 @@
<?php
use App\Content\DesignLibrary;
use App\Content\View;
$layout = [
'id' => 0,
'preset' => $preset,
'payload' => array_replace(DesignLibrary::defaults($kind), [
'brand' => '品牌名称',
'text' => '关于网站的一句话介绍。',
'links' => $layoutEditor ? [] : [['/', '首页'], ['/articles', '文章']],
'legal' => '© 品牌名称',
'action' => [['/articles', '了解更多', 'solid', false]],
]),
];
use App\Content\LayoutPage;
?>
<!doctype html>
<html lang="zh-CN">
@@ -20,12 +7,8 @@ $layout = [
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/assets/site.css">
<link rel="stylesheet" href="/assets/design-editor.css">
</head>
<body class="design-frame <?= $layoutEditor ? 'design-frame-editing' : 'design-frame-sample' ?>">
<?= View::fragment($kind, [
$kind => $layout, 'site' => ['name' => '品牌名称'], 'showHeader' => true, 'showFooter' => true,
'path' => '/', 'visitor' => null, 'member' => $preset === 'member', 'layoutEditor' => $layoutEditor,
]) ?>
<body class="layout-thumbnail">
<?= LayoutPage::sample($kind, $preset) ?>
</body>
</html>