示例工程 50-ship-and-review
50-ship-and-review/app/index.html
点击「运行示例」后,左侧显示源码、右侧显示运行结果;console 输出会实时回传。
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>上线与复盘 · 社区维修手册 v1.0</title>
<meta name="description" content="一次静态站上线的检查清单、smoke 测试、回滚方案与复盘记录。" />
<style>
* { box-sizing: border-box; }
body {
margin: 0;
min-height: 100vh;
padding: 30px 20px 40px;
background: #f8fafc;
color: #0f172a;
font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
line-height: 1.7;
}
.page { width: min(100%, 860px); margin: 0 auto; }
.site-header { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid #e2e8f0; }
.brand { font-weight: 700; letter-spacing: 0.14em; font-size: 13px; }
nav a { color: #2563eb; font-size: 13px; text-decoration: none; }
nav a + a { margin-left: 14px; }
main { padding: 22px 0; }
.eyebrow { margin: 0; color: #64748b; font-size: 11px; letter-spacing: 0.18em; }
h1 { margin: 6px 0 10px; font-size: clamp(30px, 6vw, 40px); line-height: 1.15; }
.lead { margin: 0 0 18px; color: #334155; font-size: 17px; }
section { margin-top: 24px; padding-top: 16px; border-top: 1px solid #e2e8f0; }
h2 { margin: 0 0 10px; font-size: 21px; }
h3 { margin: 16px 0 6px; font-size: 16px; }
p { margin: 0 0 12px; color: #334155; }
ul, ol { margin: 8px 0 12px; padding-left: 24px; color: #334155; }
li + li { margin-top: 4px; }
.meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.meta li { padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; }
.meta strong { display: block; color: #64748b; font-size: 11px; letter-spacing: 0.08em; }
.meta span { font-size: 14px; }
fieldset { margin: 0 0 12px; padding: 10px 14px 12px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; }
legend { padding: 0 4px; font-size: 14px; font-weight: 700; }
.checks { margin: 0; padding: 0; list-style: none; }
.checks li { display: flex; align-items: flex-start; gap: 8px; }
.checks input { margin-top: 5px; }
.checks label { font-size: 14px; color: #334155; }
.tag { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.tag.pass { background: #dcfce7; color: #166534; }
.tag.fail { background: #fee2e2; color: #991b1b; }
table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
caption { padding: 8px; text-align: left; color: #475569; font-size: 13px; }
th, td { padding: 8px 10px; border-bottom: 1px solid #e2e8f0; text-align: left; vertical-align: top; }
thead th { background: #f1f5f9; }
code { padding: 1px 5px; border-radius: 4px; background: #f1f5f9; font-family: ui-monospace, Menlo, monospace; font-size: 0.92em; }
pre { margin: 8px 0 0; padding: 10px 12px; overflow-x: auto; border-radius: 8px; background: #0f172a; color: #e2e8f0; font-size: 12px; }
pre code { padding: 0; background: none; color: inherit; }
.callout { padding: 12px 14px; border-left: 4px solid #d97706; border-radius: 6px; background: #fffbeb; color: #78350f; font-size: 14px; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card { padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; }
.card h3 { margin-top: 0; }
.card ul { margin-bottom: 0; }
footer { margin-top: 24px; padding-top: 14px; border-top: 1px solid #e2e8f0; color: #64748b; font-size: 12px; }
@media (max-width: 640px) {
body { padding: 18px 14px 32px; }
.site-header { flex-direction: column; }
.meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols { grid-template-columns: 1fr; }
}
</style>
</head>
<body>
<div class="page">
<header class="site-header">
<span class="brand">SHIP / 2026</span>
<nav aria-label="页内导航">
<a href="#checklist">清单</a>
<a href="#smoke">Smoke</a>
<a href="#rollback">回滚</a>
<a href="#review">复盘</a>
</nav>
</header>
<main>
<p class="eyebrow">PROJECT / 50</p>
<h1>上线与复盘</h1>
<p class="lead">
上线不是「部署按钮」,而是一套可重复的检查、发布、监控与回滚流程。发布后还要复盘,让下一次更稳。
</p>
<ul class="meta">
<li><strong>版本</strong><span>v1.0.0</span></li>
<li><strong>发布日</strong><span>2026-11-28</span></li>
<li><strong>负责人</strong><span>林小满</span></li>
<li><strong>状态</strong><span>已上线</span></li>
</ul>
<section id="checklist">
<h2>1. 上线前清单</h2>
<p>全部勾选才允许发布;未完成项要写明原因与负责人。</p>
<fieldset>
<legend>内容与链接</legend>
<ul class="checks">
<li><input type="checkbox" id="c1" checked /><label for="c1">12 篇指南已审校,没有占位文本</label></li>
<li><input type="checkbox" id="c2" checked /><label for="c2">所有内部链接与锚点可解析</label></li>
<li><input type="checkbox" id="c3" checked /><label for="c3">旧站 URL 已建立 301 映射</label></li>
</ul>
</fieldset>
<fieldset>
<legend>可用性与无障碍</legend>
<ul class="checks">
<li><input type="checkbox" id="c4" checked /><label for="c4">键盘可完成浏览、搜索与报修</label></li>
<li><input type="checkbox" id="c5" checked /><label for="c5">读屏可读出标题、地标与表单错误</label></li>
<li><input type="checkbox" id="c6" checked /><label for="c6">320px 宽度无横向滚动</label></li>
</ul>
</fieldset>
<fieldset>
<legend>性能、SEO 与安全</legend>
<ul class="checks">
<li><input type="checkbox" id="c7" checked /><label for="c7">LCP ≤ 2.5s,CLS ≤ 0.1</label></li>
<li><input type="checkbox" id="c8" checked /><label for="c8">sitemap、robots、canonical 正确</label></li>
<li><input type="checkbox" id="c9" checked /><label for="c9">HTTPS 证书有效,无混合内容</label></li>
</ul>
</fieldset>
</section>
<section id="smoke">
<h2>2. 上线 smoke 测试</h2>
<p>部署后立即执行,任何一项失败都按回滚流程处理。</p>
<table>
<caption>v1.0.0 线上验收结果</caption>
<thead>
<tr>
<th scope="col">检查</th>
<th scope="col">命令 / 方式</th>
<th scope="col">期望</th>
<th scope="col">结果</th>
</tr>
</thead>
<tbody>
<tr><th scope="row">首页</th><td><code>curl -I /</code></td><td>200 + text/html</td><td><span class="tag pass">PASS</span></td></tr>
<tr><th scope="row">指南详情</th><td><code>curl -I /guides/water-leak/</code></td><td>200 + 含步骤</td><td><span class="tag pass">PASS</span></td></tr>
<tr><th scope="row">旧 URL 跳转</th><td><code>curl -I /old/leak</code></td><td>301 → 新地址</td><td><span class="tag pass">PASS</span></td></tr>
<tr><th scope="row">404</th><td><code>curl -I /nope</code></td><td>404 + 引导页</td><td><span class="tag pass">PASS</span></td></tr>
<tr><th scope="row">sitemap</th><td><code>curl /sitemap.xml</code></td><td>200 + 正式页面</td><td><span class="tag pass">PASS</span></td></tr>
<tr><th scope="row">报修表单</th><td>手动 + 键盘</td><td>可填写、可提交、错误可读</td><td><span class="tag pass">PASS</span></td></tr>
</tbody>
</table>
</section>
<section id="rollback">
<h2>3. 回滚方案</h2>
<p class="callout">触发条件:首页 5xx、核心指南打不开、表单无法提交、证书错误。任一出现即回滚,不在线上排查。</p>
<ol>
<li>在发布记录中找到上一个已知良好版本。</li>
<li>重新部署该版本的静态产物。</li>
<li>确认 DNS 与证书未变。</li>
<li>重跑 smoke,记录结果。</li>
<li>在状态页说明影响范围与恢复时间。</li>
</ol>
<pre><code># 示例:回到上一个 tag 并重新构建
git checkout v0.9.3
pnpm build
pnpm deploy</code></pre>
</section>
<section id="monitor">
<h2>4. 发布后监控</h2>
<ul>
<li>首小时:每 10 分钟检查首页、指南页与表单。</li>
<li>首日:看 5xx、404、证书与 LCP。</li>
<li>首周:看搜索成功率、报修完成率与反馈。</li>
<li>异常达到阈值:暂停推广,评估回滚。</li>
</ul>
</section>
<section id="review">
<h2>5. 复盘</h2>
<div class="cols">
<div class="card">
<h3>做得好的</h3>
<ul>
<li>内容模板提前固定,审校没有返工。</li>
<li>smoke 脚本覆盖了旧 URL 与 404。</li>
<li>回滚版本提前构建并验证过。</li>
</ul>
</div>
<div class="card">
<h3>要改进的</h3>
<ul>
<li>表单错误文案在移动端偏长。</li>
<li>旧站部分图片缺少替代文本。</li>
<li>发布窗口与物业值班时间重叠。</li>
</ul>
</div>
</div>
<p>行动项:每条改进指定负责人与截止日期,进入下一迭代,而不是留在会议记录里。</p>
</section>
</main>
<footer>
<p>项目与数据均为虚构,仅用于教学。</p>
</footer>
</div>
</body>
</html>