forked from laysense/laysite
261 lines
20 KiB
PHP
261 lines
20 KiB
PHP
<?php
|
|
|
|
use App\Content\BlockTemplates;
|
|
use App\Content\View;
|
|
|
|
$escape = View::escape(...);
|
|
$sample = '/assets/system/sample.webp';
|
|
$ledger = static function (array $entries) use ($escape): string {
|
|
$html = '<div class="template-ledger">';
|
|
foreach ($entries as [$title, $text]) {
|
|
$html .= '<article><h3>' . $escape($title) . '</h3><p>' . $escape($text) . '</p></article>';
|
|
}
|
|
return $html . '</div>';
|
|
};
|
|
$next = '<ul class="studio-resources"><li><a href="/articles">阅读站点文章</a><span>资料</span></li></ul>';
|
|
|
|
$themes = [
|
|
'cobalt' => ['Cobalt · 钴蓝', '冷白纸面与细分隔线,适合技术产品和文档。', [
|
|
'cobalt-product' => ['产品发布', '把工作流程放进一个界面。', '介绍产品能解决的任务,并为访客提供可执行的下一步。', true,
|
|
[['界面与功能', '展示真实的产品界面和主要功能。'], ['使用场景', '说明它适用于怎样的工作。'], ['部署方式', '列出启动条件与使用入口。']]],
|
|
'cobalt-guide' => ['技术入门', '从第一次使用开始。', '依次列出准备条件、操作步骤和预期结果。', false,
|
|
[['准备环境', '列出启动所需的依赖。'], ['完成配置', '展示一条可复现的配置。'], ['检查结果', '说明如何判断配置生效。']]],
|
|
]],
|
|
'studio' => ['Studio · 工作室', '衬线标题、纸面网格和橙色标记,适合作品集。', [
|
|
'studio-portfolio' => ['作品集', '把做过的工作放在一起。', '用真实作品说明你的方法、范围和交付内容。', true,
|
|
[['精选项目', '为每个项目配置图片、简介和详情地址。'], ['工作方式', '向读者介绍如何发起合作。'], ['联系渠道', '留下当前可用的沟通方式。']]],
|
|
'studio-case' => ['单个项目案例', '从项目问题讲到实际交付。', '把一个项目的背景、设计过程和成果整理成可阅读的案例。', true,
|
|
[['项目背景', '介绍问题与项目约束。'], ['设计过程', '描述尝试、决定和交付步骤。'], ['项目成果', '补充实际成果、资料和图片。']]],
|
|
]],
|
|
'dusk' => ['Dusk · 暮色', '深石板背景与淡紫按钮,适合版本发布。', [
|
|
'dusk-launch' => ['发布专题', '把上线的每一步安排好。', '集中呈现发布时间、交付范围和后续支持。', true,
|
|
[['上线安排', '公布确定的上线时间和适用范围。'], ['主要改动', '让读者先了解影响使用的变化。'], ['后续支持', '说明获取帮助和反馈的方式。']]],
|
|
'dusk-updates' => ['版本与动态', '每次更新都能找到。', '把近期文章和版本说明放到同一页。', false,
|
|
[['升级说明', '记录变更、准备与恢复步骤。'], ['影响范围', '注明适用的产品和版本。'], ['反馈渠道', '告诉读者如何报告问题。']]],
|
|
]],
|
|
'vantage' => ['Vantage · 观测台', '蓝黑底色和青柠色标记,适合基础设施与运维文档。', [
|
|
'vantage-infrastructure' => ['系统概览', '把系统的组成和入口画清楚。', '说明系统职责、部署位置和日常管理入口。', true,
|
|
[['节点与入口', '列出实例位置与访问方式。'], ['部署依赖', '说明系统运行所需的外部资源。'], ['变更流程', '介绍提交、审核和部署的顺序。']]],
|
|
'vantage-runbook' => ['操作手册', '按步骤排查服务问题。', '把常用检查、回退和交接步骤集中到一页。', false,
|
|
[['确认影响', '检查受影响的服务与区域。'], ['排查变更', '核对近期配置与部署记录。'], ['恢复之后', '验证恢复结果并更新交接记录。']]],
|
|
]],
|
|
'ribbon' => ['Ribbon · 柔彩', '柔紫色封面与圆角图片,适合教程和帮助。', [
|
|
'ribbon-onboarding' => ['新手入门', '完成你的第一次上手练习。', '为新用户提供一个可跟着操作的起点。', true,
|
|
[['准备基础材料', '整理练习所需的内容和文件。'], ['完成第一个任务', '给出简洁、可完成的一条路径。'], ['回顾结果', '对照预期结果检查完成情况。']]],
|
|
'ribbon-help' => ['帮助中心', '找到眼下需要的帮助。', '集中展示常用资料和支持入口。', true,
|
|
[['快速入口', '列出最常用的几份资料。'], ['常见问题', '把重复遇到的问题整理到同一处。'], ['提交反馈', '说明需要提供的版本和操作记录。']]],
|
|
]],
|
|
'furrow' => ['Furrow · 田垄', '暖纸色与墨绿,适合办理流程和清单。', [
|
|
'furrow-service' => ['服务说明', '从准备材料到完成办理。', '清楚说明能提供的服务,以及开始办理需要满足的条件。', true,
|
|
[['确认需求', '明确办理目标、范围和预期。'], ['准备材料', '列出当前适用的材料清单。'], ['跟进办理', '说明进度查询和沟通方式。']]],
|
|
'furrow-checklist' => ['准备清单', '把需要准备的事项列清。', '发布一份可逐项核对的清单和办理须知。', false,
|
|
[['核对要求', '列出提交前需要确认的信息。'], ['准备文件', '整理文件类型、格式和必要说明。'], ['下一步', '提供提交入口和支持链接。']]],
|
|
]],
|
|
];
|
|
|
|
$groups = [];
|
|
foreach ($themes as $theme => [$name, $description, $templates]) {
|
|
$pages = [];
|
|
foreach ($templates as $key => [$label, $heading, $lead, $visual, $entries]) {
|
|
$sections = [
|
|
['overview', $entries[0][0], 'plain', $ledger($entries), null],
|
|
['details', '补充说明', 'tinted', '<div class="studio-two-column"><article><h3>查看细节</h3><p>按需要补充步骤、材料或时间。</p></article><article><h3>确认下一步</h3><p>在这里写明访问者可以执行的操作。</p></article></div>', null],
|
|
['resources', '相关资料', 'plain', $next, null],
|
|
];
|
|
if ($key === 'dusk-updates') {
|
|
$sections[0] = ['updates', '最新动态', 'plain', '', BlockTemplates::ARTICLE_FEED];
|
|
}
|
|
if ($key === 'ribbon-help') {
|
|
$sections[1] = ['questions', '常见问题', 'tinted', '<div class="faq"><details><summary>从哪里开始?</summary><div><p>先查看入门资料,再按当前产品版本选择对应说明。</p></div></details><details><summary>如何定位问题?</summary><div><p>记录当前版本、操作步骤和看到的结果。</p></div></details></div>', null];
|
|
}
|
|
$pages[$key] = [
|
|
'name' => $label, 'heading' => $heading, 'description' => $lead,
|
|
'image' => $visual ? $sample : '', 'alt' => $visual ? '版式示例' : '',
|
|
'actions' => [['#' . $sections[0][0], '查看' . $sections[0][1], 'solid', false]],
|
|
'sections' => $sections,
|
|
];
|
|
}
|
|
$groups[$theme] = compact('name', 'description', 'pages');
|
|
}
|
|
|
|
$suites = [
|
|
'gather' => ['Gather · 会场', '暖黄封面与平铺议程,适合会议、工作坊和展览。', [
|
|
'gather-conference' => ['会议与工作坊', '留一天,和同行动手做。', '汇总会议议程、嘉宾及到场信息。', [
|
|
['agenda', '当日议程', 'event-agenda'], ['speakers', '分享嘉宾', 'speaker-lineup'], ['venue', '如何到场', 'venue-guide'],
|
|
]],
|
|
'gather-exhibition' => ['展览导览', '用一个下午,走进你的展厅。', '呈现展览主题、参观方式和现场活动。', [
|
|
['exhibition', '展览主题', 'editorial-feature'], ['venue', '参观信息', 'venue-guide'], ['sessions', '现场活动', 'event-agenda'],
|
|
]],
|
|
]],
|
|
'market' => ['Market · 商店', '霜绿与墨色,适合商品详情和服务预约。', [
|
|
'market-product' => ['商品详情', '把材料和细节讲清楚。', '展示商品及规格,提供咨询和订购入口。', [
|
|
['product', '精选商品', 'product-spotlight'], ['specifications', '规格与交付', 'product-specifications'], ['get-in-touch', '订购咨询', 'contact-card'],
|
|
]],
|
|
'market-service' => ['服务预约', '从第一次沟通到完成交付。', '帮助客户了解服务流程、方案和咨询方式。', [
|
|
['process', '服务流程', 'service-process'], ['plans', '选择服务方案', 'pricing'], ['get-in-touch', '预约咨询', 'contact-card'],
|
|
]],
|
|
]],
|
|
'dispatch' => ['Dispatch · 编辑部', '高对比衬线标题和细分隔线,适合专题报道与刊物。', [
|
|
'dispatch-feature' => ['专题报道', '围绕一个问题,读得更深。', '把导读、相关报道和延伸资料串成一条路径。', [
|
|
['feature', '本期导读', 'editorial-feature'], ['reading', '按顺序阅读', 'reading-path'], ['resources', '延伸资料', 'resources'],
|
|
]],
|
|
'dispatch-magazine' => ['刊物首页', '把新一期放到读者面前。', '集中呈现最新文章、编辑说明和联系入口。', [
|
|
['issue', '最新文章', 'articles'], ['editors', '编辑手记', 'editorial-feature'], ['get-in-touch', '联系编辑部', 'contact-card'],
|
|
]],
|
|
]],
|
|
];
|
|
$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 => $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] ?? []);
|
|
}
|
|
}
|
|
|
|
$newSuites = [
|
|
'atrium' => ['Atrium · 场馆', '日光、宽幅留白和陶土色,适合展览、场馆和预约。', [
|
|
'atrium-exhibition' => ['展览首页', '让作品先开口。', '用策展导读、展品和参观信息介绍正在举行的展览。', [
|
|
['curators-note', '策展导读', 'editorial-feature'], ['selected', '展品一览', 'gallery'], ['visit', '预约参观', 'venue-guide'],
|
|
], $photo],
|
|
'atrium-calendar' => ['活动日历', '把下一场活动安排进日程。', '汇总导览、讲座和开放工作坊,并提供报名入口。', [
|
|
['calendar', '近期活动', 'event-agenda'], ['hosts', '活动嘉宾', 'speaker-lineup'], ['register', '预约报名', 'event-registration'],
|
|
]],
|
|
'atrium-access' => ['参观指南', '从出发到抵达,都有清楚的指引。', '说明开放时间、到达方式、无障碍入口和联系方式。', [
|
|
['arrival', '交通与入口', 'venue-guide'], ['questions', '参观答疑', 'faq'], ['get-in-touch', '联系场馆', 'contact-card'],
|
|
]],
|
|
]],
|
|
'harbor' => ['Harbor · 社群', '墨蓝、暖黄和轻柔圆角,适合志愿团队和社区项目。', [
|
|
'harbor-community' => ['社群首页', '和愿意动手的人一起做事。', '用正在进行的项目和参与方式介绍社群。', [
|
|
['mission', '我们在做什么', 'split-story-left'], ['projects', '正在进行的项目', 'network'], ['get-in-touch', '加入社群', 'contact-card'],
|
|
], $photo],
|
|
'harbor-volunteer' => ['志愿者招募', '把自己擅长的一件事带进来。', '说明可认领的任务、参与时间和报名流程。', [
|
|
['roles', '可以认领的任务', 'features'], ['process', '从报名到开始', 'timeline'], ['get-in-touch', '提交申请', 'contact-card'],
|
|
]],
|
|
'harbor-report' => ['阶段报告', '把这一阶段的进展交代清楚。', '展示关键数据、实际成果和下一阶段安排。', [
|
|
['impact', '阶段数据', 'metrics'], ['updates', '项目简报', 'articles'], ['next-steps', '下一阶段', 'timeline'],
|
|
]],
|
|
]],
|
|
'index' => ['Index · 资料库', '紫墨与浅灰纸面,适合研究资料、课程参考和开放文档。', [
|
|
'index-library' => ['资料库首页', '从一份可靠的资料开始。', '为读者提供主题入口、近期更新和检索指引。', [
|
|
['subjects', '按主题阅读', 'reading-path'], ['records', '最新资料', 'articles'], ['help', '使用答疑', 'faq'],
|
|
], $interface],
|
|
'index-study' => ['研究专题', '把证据、结论和出处放在一起。', '清楚交代研究问题,并提供阅读顺序与相关资料。', [
|
|
['overview', '研究导读', 'editorial-feature'], ['findings', '阶段发现', 'table'], ['sources', '参考资料', 'resources'],
|
|
]],
|
|
'index-reference' => ['使用手册', '把容易忘记的步骤记下来。', '整理操作示例、准备清单和后续支持。', [
|
|
['prepare', '准备清单', 'checklist'], ['examples', '操作示例', 'reference-code'], ['get-in-touch', '获取支持', 'support-channels'],
|
|
]],
|
|
]],
|
|
];
|
|
foreach ($newSuites as $theme => [$name, $description, $templates]) {
|
|
$pages = [];
|
|
foreach ($templates as $key => $template) {
|
|
$pages[$key] = $compose($template, $template[4] ?? []);
|
|
}
|
|
$groups[$theme] = compact('name', 'description', 'pages');
|
|
}
|
|
|
|
return $groups;
|