Prepare LaySite 1.4.4 editor templates and MCP settings

This commit is contained in:
2026-11-27 20:44:07 +08:00
parent bc58b438d4
commit d41df011f9
51 changed files with 474 additions and 112 deletions
+104 -16
View File
@@ -104,26 +104,114 @@ $suites = [
]],
]],
];
$compose = static function (array $template, array $image = []): array {
[$label, $heading, $lead, $blocks] = $template;
$hasContact = in_array('get-in-touch', array_column($blocks, 0), true);
$sections = [];
foreach ($blocks as $index => [$anchor, $title, $component]) {
$block = BlockTemplates::find($component);
$body = $hasContact
? str_replace(['href="#contact"', 'href="/#contact"'], 'href="#get-in-touch"', $block[1])
: $block[1];
$sections[] = [$anchor, $title, $index % 2 ? 'tinted' : 'plain', $body, $block[3] ?? null];
}
return [
'name' => $label, 'heading' => $heading, 'description' => $lead,
'image' => $image[0] ?? '', 'alt' => $image[1] ?? '',
'actions' => [['#' . $sections[0][0], '查看' . $sections[0][1], 'solid', false]],
'sections' => $sections,
];
};
foreach ($suites as $theme => [$name, $description, $templates]) {
$pages = [];
foreach ($templates as $key => [$label, $heading, $lead, $blocks]) {
$sections = [];
foreach ($blocks as $index => [$anchor, $title, $component]) {
$block = BlockTemplates::find($component);
$body = $theme === 'market'
? str_replace(['href="#contact"', 'href="/#contact"'], 'href="#get-in-touch"', $block[1])
: $block[1];
$sections[] = [$anchor, $title, $index % 2 ? 'tinted' : 'plain', $body, $block[3] ?? null];
}
$visual = $key === 'market-product';
$pages[$key] = [
'name' => $label, 'heading' => $heading, 'description' => $lead,
'image' => $visual ? $sample : '', 'alt' => $visual ? '商品展示版式示例' : '',
'actions' => [['#' . $sections[0][0], '查看' . $sections[0][1], 'solid', false]],
'sections' => $sections,
];
foreach ($templates as $key => $template) {
$image = $key === 'market-product' ? [$sample, '商品展示版式示例'] : [];
$pages[$key] = $compose($template, $image);
}
$groups[$theme] = compact('name', 'description', 'pages');
}
$photo = [BlockTemplates::DESIGN_STUDIO_IMAGE, '自然光下的设计工作台'];
$interface = [$sample, '产品界面示例'];
$additionalPages = [
'cobalt' => [
'cobalt-integrations' => ['集成与生态', '在现有工具里继续工作。', '为客户展示可集成的平台、配置方法和支持渠道。', [
['integrations', '集成场景', 'split-balanced-right'], ['setup', '连接与检查', 'reference-code'], ['support', '获取支持', 'support-channels'],
], $interface],
'cobalt-plans' => ['方案与价格', '为你的团队选择方案。', '比较两种方案的适用范围、价格与支持方式。', [
['plans', '方案对比', 'plan-comparison'], ['pricing', '费用与服务', 'pricing'], ['get-in-touch', '订购咨询', 'contact-card'],
]],
],
'studio' => [
'studio-about' => ['关于工作室', '认识作品背后的人。', '分享工作室的创作环境、团队背景和合作方式。', [
['workroom', '工作环境', 'split-story-right'], ['process', '合作流程', 'service-process'], ['get-in-touch', '发起合作', 'contact-card'],
], $photo],
'studio-services' => ['设计服务', '让项目从一个清晰的问题开始。', '介绍你的设计服务、交付流程和委托方式。', [
['services', '服务范围', 'cover-photo-left'], ['workflow', '项目流程', 'service-process'], ['get-in-touch', '项目咨询', 'contact-card'],
]],
],
'dusk' => [
'dusk-preview' => ['功能预览', '提前体验正在打磨的功能。', '展示功能预览、实际演示和后续参与方式。', [
['features', '功能预览', 'split-alternating'], ['demo', '视频演示', 'video-demo-right'], ['signup', '参与体验', 'support-channels'],
], $interface],
'dusk-roadmap' => ['产品路线图', '把接下来的改进摊开来看。', '整理近期交付、下一阶段计划以及反馈渠道。', [
['milestones', '近期里程碑', 'timeline'], ['releases', '已交付内容', 'changelog'], ['feedback', '提交建议', 'support-channels'],
]],
],
'vantage' => [
'vantage-health' => ['服务状态说明', '快速了解服务的运行情况。', '汇总已知问题、影响范围和后续更新入口。', [
['overview', '影响范围', 'notice'], ['incidents', '处理进展', 'timeline'], ['updates', '相关公告', 'articles'],
]],
'vantage-deploy' => ['部署指南', '让服务在新环境中运行起来。', '按准备、执行、检查三个阶段组织部署文档。', [
['requirements', '准备工作', 'split-guide-left'], ['commands', '运行与检查', 'reference-code'], ['support', '部署问题', 'faq'],
], $interface],
],
'ribbon' => [
'ribbon-lessons' => ['课程概览', '跟着演示完成一次练习。', '先准备素材,再观看演示,最后按步骤提交结果。', [
['prepare', '课前准备', 'split-guide-right'], ['lesson', '课程演示', 'video-demo-right'], ['practice', '课后练习', 'checklist'],
], $interface],
'ribbon-learning-path' => ['学习路径', '把零散的知识串成一条路线。', '为读者安排一个可以循序完成的学习计划。', [
['path', '学习路线', 'reading-path'], ['example', '示例与说明', 'split-balanced-left'], ['questions', '学习答疑', 'faq'],
]],
],
'furrow' => [
'furrow-eligibility' => ['办理条件', '开始前先确认适用范围。', '列出办事条件、要准备的材料和咨询方式。', [
['requirements', '适用条件', 'split-guide-right'], ['materials', '材料清单', 'checklist'], ['support', '咨询窗口', 'contact-card'],
]],
'furrow-follow-up' => ['进度与补充材料', '提交以后,每一步都有说明。', '说明办理进度、补充材料的要求和对接方式。', [
['progress', '办理阶段', 'timeline'], ['documents', '补充材料', 'resources'], ['support', '联系办理人员', 'contact-card'],
]],
],
'gather' => [
'gather-workshop' => ['工作坊报名', '留一个下午,动手做一件作品。', '说明工作坊内容、参与条件及报名方式。', [
['workshop', '工作坊主题', 'split-story-left'], ['agenda', '当天安排', 'event-agenda'], ['register', '活动报名', 'event-registration'],
], $photo],
'gather-visit' => ['参观与交通', '提前规划你的到场路线。', '为访客汇总预约方式、会场安排和到场信息。', [
['arrival', '如何到场', 'venue-guide'], ['lineup', '现场场次', 'event-agenda'], ['questions', '参观答疑', 'faq'],
]],
],
'market' => [
'market-collection' => ['系列新品', '用一组作品讲清楚一个主题。', '展示系列灵感、精选商品和订购方式。', [
['collection', '系列灵感', 'split-story-right'], ['featured', '精选商品', 'product-spotlight'], ['get-in-touch', '订购咨询', 'contact-card'],
], $photo],
'market-aftercare' => ['交付与售后', '从收到商品到长期使用。', '汇总交付说明、维护建议和售后渠道。', [
['delivery', '交付安排', 'product-specifications'], ['care', '使用与保养', 'faq'], ['get-in-touch', '售后支持', 'support-channels'],
]],
],
'dispatch' => [
'dispatch-interview' => ['访谈特写', '从一个细节听见完整的故事。', '用一张图片、一段导语和一条阅读路径组织访谈。', [
['profile', '人物与背景', 'split-story-left'], ['interview', '访谈导读', 'editorial-feature'], ['related', '延伸阅读', 'reading-path'],
], $photo],
'dispatch-archive' => ['往期索引', '沿着兴趣找到以前的报道。', '集中呈现近期文章、栏目入口和编辑部联系方式。', [
['archive', '文章归档', 'articles'], ['topics', '按主题阅读', 'reading-path'], ['get-in-touch', '联系编辑部', 'contact-card'],
]],
],
];
foreach ($additionalPages as $theme => $templates) {
foreach ($templates as $key => $template) {
$groups[$theme]['pages'][$key] = $compose($template, $template[4] ?? []);
}
}
return $groups;
+6
View File
@@ -2,6 +2,12 @@ CREATE TABLE IF NOT EXISTS site_settings (
id INTEGER PRIMARY KEY CHECK (id = 1),
payload TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS mcp_settings (
id INTEGER PRIMARY KEY CHECK (id = 1),
enabled INTEGER NOT NULL CHECK (enabled IN (0, 1)),
encrypted_secret TEXT,
version INTEGER NOT NULL
);
CREATE TABLE IF NOT EXISTS design_presets (
id INTEGER PRIMARY KEY AUTOINCREMENT,
kind TEXT NOT NULL CHECK (kind IN ('header', 'footer', 'palette')),