From c1e3d309546fe75659fdac339af360f6939e990f Mon Sep 17 00:00:00 2001 From: wait4xx Date: Sun, 1 Nov 2026 09:05:26 +0800 Subject: [PATCH 01/13] =?UTF-8?q?chore(spec):=20=E7=AB=8B=E9=A1=B9=20blog-?= =?UTF-8?q?5f=E2=80=94=E2=80=94SEO=20=E8=A7=A3=E5=B0=81+=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=89=B9+=E7=BE=8E=E5=8C=96=E9=A6=96?= =?UTF-8?q?=E6=89=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Spec: 2026-10-26_blog-5f Co-authored-by: GLM-5.3 --- .spec/specs/2026-10-26_blog-5f/spec.md | 87 +++++++++++++++++++++++++ .spec/specs/2026-10-26_blog-5f/tasks.md | 51 +++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 .spec/specs/2026-10-26_blog-5f/spec.md create mode 100644 .spec/specs/2026-10-26_blog-5f/tasks.md diff --git a/.spec/specs/2026-10-26_blog-5f/spec.md b/.spec/specs/2026-10-26_blog-5f/spec.md new file mode 100644 index 0000000..274ba67 --- /dev/null +++ b/.spec/specs/2026-10-26_blog-5f/spec.md @@ -0,0 +1,87 @@ +# Phase 5f:SEO 解封与功能优化批 + 美化首批 - 项目范围 + + + +## 1. 问题定义 +- **项目目标**:①解除生产全站 noindex 封印并补齐 SEO 基建(事故级:上线至今搜索引擎不可见)②修双语暗伤(localePath 双 en/canonical/尾斜杠)③构建期内容 lint+生产冒烟防线 ④reader 纯文本模式 ⑤美化首批 K-Q(流距 token 化/灰阶补档/首屏 tagline/图库质感/微交互/代码块窗条/书评纸面板,全部经视觉模型裁定定案) +- **目标用户**:站长(写作/发布/被搜索到)与读者(阅读质感/双语导航正确性) +- **核心价值**:站点从"隐身可用"到"可被发现+有质感";发布链自带质检 + +## 2. 假设与待确认 + +### 2.1 已确认事实 +- noindex 来源=/etc/nginx/snippets/esa-origin-ssl.conf:11(我已 curl+grep 实锤);robots.txt 生产 404;ESA 头缓存 30 天 +- localePath 在 en→en 场景产出 /en/en/...(404) +- Artalk 评论数端点已实测(GET /api/v2/comments?site_name=wait4x.online&limit=0 → count) +- 美化七问已由 glm-5.3-flash:max 逐图裁定(docs/research/08 §6) + +### 2.2 关键假设 +- nginx sudo 与 ESA 控制台由用户操作(本包只备好仓库侧与操作单) +- 视觉裁定为终态依据;实现与裁定冲突时以裁定为准并在完成总结记录 + +### 2.3 待确认问题 +- [x] 美化两案之争 → 视觉模型裁定完成(08 文档 §6),无悬案 +- [x] 本批范围 → 用户 2026-10-26 全批(A/B/C/E+K-Q;R 热力图暗色与 S 并入 N 后的下一批) + +### 2.4 可选解释与取舍 +- 纸面板=全边框圆角卡(裁定)优于通栏 hairline——保留标题区外置结构 +- 代码块窗条仅 ≥4 行块;三点换灰阶(红线优先于 macOS 梗) +- 图库亮色直贴/暗色 4% 衬底(双模式分判) + +### 2.5 已证伪路径 +- 首屏 banner 化/大字标语(视觉裁定否决——克制红线) +- 热力图亮色换绿(裁定否决——全页最大色块压灰阶骨架) +- 页面标题 27→22px(裁定否决——层级锚点,要轻减字重不减号) + +## 3. 功能范围 + +### 3.1 核心功能(MVP) +- [ ] T1 SEO 仓库侧三件:robots.txt 新建 + /admin 局部 noindex 预案 + 用户操作单(nginx/ESA) +- [ ] T2 localePath 双 en 修复 + 自指 canonical + 尾斜杠归一 +- [ ] T3 构建期内容 lint(断链/图片/frontmatter/双语配对)+ 生产冒烟脚本 + build.sh 守卫挂载 +- [ ] T4 reader 纯文本模式(html.reader 单 class + 命令面板 reader + r 键 + localStorage) +- [ ] T5 代码块窗条(P 卡:≥4 行灰阶窗+mono 标题+灰阶三点,单行裸 pill) +- [ ] T6 书评纸面板(Q 卡:圆角米灰纸卡+暗色暖棕+hairline 边框防长文竖线感) +- [ ] T7 版式基底(K/L/O 卡:正文流距 token 化+灰阶补档+暗色 hairline 降档+微交互曲线统一+focus ring 收尾) +- [ ] T8 首屏 tagline + 图库质感(M/N 卡:IdCard 身份语≤20 字+图库圆角统一+暗色 4% 衬底) + +### 3.2 扩展功能 +- 无(R 热力图暗色补救列下一批) + +### 3.3 不在范围内 +- nginx/ESA 实际操作(用户侧);draft 路由 D、评论数 F、EXIF 卡 G、title H(本月批后续包) + +## 4. 最小实现路径 +- 最简单可行方案:token 值级 CSS 改动为主 + locale.ts 单函数修 + 两个构建脚本;无新依赖 +- 暂不引入:blur-up 占位(需管线)、独立设置面板 +- 不做的抽象:主题引擎化/样式体系重构(tokens 增量演化) + +## 5. 技术决策 +- 技术栈:既有 Astro+tokens 体系;lint 用 node 脚本(复用 build-perf 目录与守卫模式) +- 证据协议:evidence: runs +- 本轮允许改动:src/lib/locale.ts、src/layouts/BaseLayout.astro、src/styles/{tokens,global}.css、src/components/{CommandPalette,IdCard*}.astro、src/components/geek/Keyboard.astro、GalleryPage.astro、prose 相关组件、public/robots.txt、scripts/build-perf/、infra/deploy/build.sh、tests/e2e.mjs +- 本轮不应触碰:nginx/ESA(用户)、Header/Footer 结构、sw.js(无涉)、热力图组件 +- Git integration branch:`spec/2026-10-26_blog-5f` + +### 5.1 验证策略 +- 范围级别:package +- 变更对象:SEO 基建文件、locale 工具、构建链 lint 挂载、reader/美化涉及的样式与组件 +- 快速检查:`pnpm astro build` +- 集成检查:`node tests/e2e.mjs`(33 项)+ 本包新增断言(canonical/localePath/reader/窗条/纸面板 computed-style) +- 全项目检查:生产 Lighthouse SEO≥95(依赖用户 nginx/ESA 完成后复测入档);移动溢出密集扫描(美化改动面涉及布局 token 时) +- 升级触发:若 T7 灰阶补档波及 Header/导航布局,升级为全站密集扫描并记录 + +## 6. 成功标准与验证方式 +- [ ] dist 每页含自指 canonical 且 en 页无 /en/en/ -> verify: task_0002 +- [ ] robots.txt 产物存在且含 Sitemap 行 -> verify: task_0001 +- [ ] 人为断链能让 build 输出 FAIL 清单(warn 一周策略首版即 fail 可议) -> verify: task_0003 +- [ ] reader 触发后 .bg-glow 隐藏/ICP 可见/刷新保持 -> verify: task_0004 +- [ ] 多行代码块有窗条与灰阶三点、单行无 -> verify: task_0005 +- [ ] 书评正文为圆角纸卡(computed border-radius+背景) -> verify: task_0006 +- [ ] 流距 token 生效(h2 前后距为变量值)+focus ring 统一 -> verify: task_0007 +- [ ] 首屏 tagline 渲染≤20 字+图库圆角统一 -> verify: task_0008 + +## 7. 风险与约束 +- 灰阶红线:所有美化以 08 §6 裁定为终态依据 +- build.sh 引用新脚本守卫先行(车道纪律);lint 首版 fail 可降 warn 一周(发布链安全优先) +- 多车道并行:T2/T3(op-gitea)、T5/T6(op-artalk)、T1/T4/T7/T8(orchestrator);共享文件按 boundary 划界,global.css/tokens 仅 orchestrator 动 diff --git a/.spec/specs/2026-10-26_blog-5f/tasks.md b/.spec/specs/2026-10-26_blog-5f/tasks.md new file mode 100644 index 0000000..1dd208c --- /dev/null +++ b/.spec/specs/2026-10-26_blog-5f/tasks.md @@ -0,0 +1,51 @@ +# 任务清单:Phase 5f(SEO 解封与功能优化批 + 美化首批) + +说明:verify 命令均在仓库根执行;车道工作树开发禁 git,收编由 orchestrator 统一提交。 + +- [ ] T1 + - id: task_0001 + - title: SEO 仓库侧三件(robots.txt + admin noindex 预案 + 用户操作单) + - boundary: public/robots.txt(新建)、docs/上线检查单.md(追加操作单节) + - verify: `test -f public/robots.txt && grep -q "Sitemap: https://wait4x.online/sitemap-index.xml" public/robots.txt && grep -q "Disallow: /admin" public/robots.txt && test -f dist/robots.txt` + +- [ ] T2 + - id: task_0002 + - title: localePath 双 en 修复 + 自指 canonical + 尾斜杠归一 + - boundary: src/lib/locale.ts、src/layouts/BaseLayout.astro(canonical 行)、src/components/Header.astro(nav-lang href 尾斜杠) + - verify: `! grep -r "/en/en/" dist/ && grep -q 'rel="canonical"' dist/en/archives/mian-sha/index.html && node tests/e2e.mjs 2>&1 | grep -q "33/33 PASS"` + +- [ ] T3 + - id: task_0003 + - title: 构建期内容 lint + 生产冒烟 + build.sh 守卫挂载 + - boundary: scripts/build-perf/content-lint.mjs(新)、scripts/build-perf/prod-smoke.sh(新)、infra/deploy/build.sh(守卫行) + - verify: `node scripts/build-perf/content-lint.mjs dist && bash -n infra/deploy/build.sh && test -x scripts/build-perf/prod-smoke.sh` + +- [ ] T4 + - id: task_0004 + - title: reader 纯文本模式(html.reader + 命令面板 + r 键 + 持久化) + - boundary: src/styles/global.css(reader 段)、src/components/CommandPalette.astro、src/components/geek/Keyboard.astro、src/i18n/ui.ts(cmd_reader 键) + - verify: `node tests/e2e.mjs 2>&1 | grep -q "33/33 PASS" && grep -q "reader" src/components/CommandPalette.astro && grep -q "html.reader" src/styles/global.css` + +- [ ] T5 + - id: task_0005 + - title: 代码块窗条(P 卡:≥4 行灰阶窗+mono 标题+灰阶三点) + - boundary: 技术轨正文组件的代码块样式(GalleryPage 之外;具体落点车道自查源码定)+ global.css 如需 + - verify: `node tests/e2e.mjs 2>&1 | grep -q "33/33 PASS" && grep -qE "code-win|codewin" src/styles/global.css src/components/ -r` + +- [ ] T6 + - id: task_0006 + - title: 书评纸面板(Q 卡:圆角米灰纸卡+暗色暖棕+hairline 边框) + - boundary: 书评轨正文容器样式(prose-reading 相关组件/tokens.css 新增 --paper 变量可与 T7 协同由 orchestrator 统一入 tokens) + - verify: `node tests/e2e.mjs 2>&1 | grep -q "33/33 PASS" && grep -qE "paper" src/styles/tokens.css src/styles/global.css -r` + +- [ ] T7 + - id: task_0007 + - title: 版式基底(K/L/O 卡:流距 token+灰阶补档+暗色 hairline 降档+微交互曲线+focus ring) + - boundary: src/styles/tokens.css、src/styles/global.css(本卡为 orchestrator 专属车道,他人不并改动两文件) + - verify: `node tests/e2e.mjs 2>&1 | grep -q "33/33 PASS" && grep -q "flow-h2-pre" src/styles/tokens.css && grep -q "focus-ring\|focus-visible" src/styles/global.css` + +- [ ] T8 + - id: task_0008 + - title: 首屏 tagline + 图库质感(M/N 卡:身份语+圆角统一+暗色 4% 衬底) + - boundary: src/components/IdCard.astro 或首页身份区、src/components/pages/GalleryPage.astro(stage 暗色衬底+radius 统一) + - verify: `node tests/e2e.mjs 2>&1 | grep -q "33/33 PASS" && grep -q "tagline\|身份" src/pages/index.astro src/components/ -r | head -1` From 5d18591967a8eb3751a35e76eb485d437fbadc71 Mon Sep 17 00:00:00 2001 From: wait4xx Date: Sun, 1 Nov 2026 09:06:02 +0800 Subject: [PATCH 02/13] =?UTF-8?q?chore(spec):=20blog-5f=20=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=B8=85=E5=8D=95=E6=A0=BC=E5=BC=8F=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Spec: 2026-10-26_blog-5f Co-authored-by: GLM-5.3 --- .spec/specs/2026-10-26_blog-5f/tasks.md | 75 ++++++++++++------------- 1 file changed, 35 insertions(+), 40 deletions(-) diff --git a/.spec/specs/2026-10-26_blog-5f/tasks.md b/.spec/specs/2026-10-26_blog-5f/tasks.md index 1dd208c..fdce25a 100644 --- a/.spec/specs/2026-10-26_blog-5f/tasks.md +++ b/.spec/specs/2026-10-26_blog-5f/tasks.md @@ -1,51 +1,46 @@ -# 任务清单:Phase 5f(SEO 解封与功能优化批 + 美化首批) +# Phase 5f:SEO 解封与功能优化批 + 美化首批 - 任务拆解 -说明:verify 命令均在仓库根执行;车道工作树开发禁 git,收编由 orchestrator 统一提交。 +## 使用规则 +- boundary/verify 齐备;verify 只读断言;车道工作树开发禁 git,收编由 orchestrator 统一提交 -- [ ] T1 - - id: task_0001 - - title: SEO 仓库侧三件(robots.txt + admin noindex 预案 + 用户操作单) - - boundary: public/robots.txt(新建)、docs/上线检查单.md(追加操作单节) - - verify: `test -f public/robots.txt && grep -q "Sitemap: https://wait4x.online/sitemap-index.xml" public/robots.txt && grep -q "Disallow: /admin" public/robots.txt && test -f dist/robots.txt` +## 阶段一:实现 -- [ ] T2 - - id: task_0002 - - title: localePath 双 en 修复 + 自指 canonical + 尾斜杠归一 - - boundary: src/lib/locale.ts、src/layouts/BaseLayout.astro(canonical 行)、src/components/Header.astro(nav-lang href 尾斜杠) +- [ ] T1 SEO 仓库侧三件(robots.txt + admin noindex 预案 + 用户操作单) + - claim: orchestrator + - boundary: 新建 public/robots.txt(Allow 全站;Disallow /admin/ /draft/;Sitemap 行);docs/上线检查单.md 追加「SEO 解封操作单」节(nginx snippet 行号/内部 vhost 补回清单/ESA purge+TTL+绕缓存三动作);nginx/ESA 实操归用户 + - verify: `test -f public/robots.txt && grep -q "Sitemap: https://wait4x.online/sitemap-index.xml" public/robots.txt && grep -q "Disallow: /admin" public/robots.txt && grep -q "SEO 解封操作单" docs/上线检查单.md` + +- [ ] T2 localePath 双 en 修复 + 自指 canonical + 尾斜杠归一 + - claim: op-gitea(mesh 车道) + - boundary: src/lib/locale.ts(先归一 zh 再拼前缀);BaseLayout.astro 加自指 canonical(Astro.site+withSlash);Header.astro nav-lang href 尾斜杠补齐;E2E 可加断言 - verify: `! grep -r "/en/en/" dist/ && grep -q 'rel="canonical"' dist/en/archives/mian-sha/index.html && node tests/e2e.mjs 2>&1 | grep -q "33/33 PASS"` -- [ ] T3 - - id: task_0003 - - title: 构建期内容 lint + 生产冒烟 + build.sh 守卫挂载 - - boundary: scripts/build-perf/content-lint.mjs(新)、scripts/build-perf/prod-smoke.sh(新)、infra/deploy/build.sh(守卫行) +- [ ] T3 构建期内容 lint + 生产冒烟 + build.sh 守卫挂载 + - claim: op-gitea(mesh 车道) + - boundary: 新建 scripts/build-perf/content-lint.mjs(dist 断链:站内 a[href] 逐一对产物;图片存在性;zh/en 配对警告)+ scripts/build-perf/prod-smoke.sh(curl robots/sitemap/首页头三断言);build.sh 守卫行(存在性守卫铁律);首版 fail 但提供 SKIP 环境变量逃生门 - verify: `node scripts/build-perf/content-lint.mjs dist && bash -n infra/deploy/build.sh && test -x scripts/build-perf/prod-smoke.sh` -- [ ] T4 - - id: task_0004 - - title: reader 纯文本模式(html.reader + 命令面板 + r 键 + 持久化) - - boundary: src/styles/global.css(reader 段)、src/components/CommandPalette.astro、src/components/geek/Keyboard.astro、src/i18n/ui.ts(cmd_reader 键) - - verify: `node tests/e2e.mjs 2>&1 | grep -q "33/33 PASS" && grep -q "reader" src/components/CommandPalette.astro && grep -q "html.reader" src/styles/global.css` +- [ ] T4 reader 纯文本模式(html.reader + 命令面板 + r 键 + 持久化) + - claim: orchestrator + - boundary: global.css 尾部集中 html.reader 段(按 08 文档 §4.4 清单:隐 bg-glow/进度条/收 Header 尾部钮/Footer 收单行 ICP 必留;正文字号微升行宽收窄);CommandPalette data-cmd="reader" + ui.ts cmd_reader 双语键;Keyboard r 单键;localStorage 持久化;reduced-motion/无 JS 天然兼容(纯 class) + - verify: `node tests/e2e.mjs 2>&1 | grep -q "33/33 PASS" && grep -q 'data-cmd="reader"' src/components/CommandPalette.astro && grep -q "html.reader" src/styles/global.css` -- [ ] T5 - - id: task_0005 - - title: 代码块窗条(P 卡:≥4 行灰阶窗+mono 标题+灰阶三点) - - boundary: 技术轨正文组件的代码块样式(GalleryPage 之外;具体落点车道自查源码定)+ global.css 如需 - - verify: `node tests/e2e.mjs 2>&1 | grep -q "33/33 PASS" && grep -qE "code-win|codewin" src/styles/global.css src/components/ -r` +- [ ] T5 代码块窗条(P 卡:≥4 行灰阶窗+mono 标题+灰阶三点) + - claim: op-artalk(mesh 车道) + - boundary: 技术轨代码块渲染层(自查源码定落点:prose-tech 容器/全局 pre 样式);≥4 行块加窗条(灰阶三点非红黄绿+mono 语言/文件标签),单行块裸 pill;亮暗双态;scoped 样式优先不动 global.css(与 T7 划界) + - verify: `node tests/e2e.mjs 2>&1 | grep -q "33/33 PASS" && grep -rqE "code-win|codebar|窗条" src/styles/ src/components/` -- [ ] T6 - - id: task_0006 - - title: 书评纸面板(Q 卡:圆角米灰纸卡+暗色暖棕+hairline 边框) - - boundary: 书评轨正文容器样式(prose-reading 相关组件/tokens.css 新增 --paper 变量可与 T7 协同由 orchestrator 统一入 tokens) - - verify: `node tests/e2e.mjs 2>&1 | grep -q "33/33 PASS" && grep -qE "paper" src/styles/tokens.css src/styles/global.css -r` +- [ ] T6 书评纸面板(Q 卡:圆角米灰纸卡+暗色暖棕+hairline 边框) + - claim: op-artalk(mesh 车道) + - boundary: 书评正文容器(prose-reading 所在组件 scoped 样式):圆角纸卡+米灰 #f4f4f2 系亮/暖棕暗态;边框 hairline 级防长文竖线感(08 裁定 §6-2);标题区外置结构不动;--paper 变量需求提给 orchestrator 入 tokens(T7 协同),不直接改 tokens.css + - verify: `node tests/e2e.mjs 2>&1 | grep -q "33/33 PASS" && grep -rq "paper" src/components/ | grep -v node_modules` -- [ ] T7 - - id: task_0007 - - title: 版式基底(K/L/O 卡:流距 token+灰阶补档+暗色 hairline 降档+微交互曲线+focus ring) - - boundary: src/styles/tokens.css、src/styles/global.css(本卡为 orchestrator 专属车道,他人不并改动两文件) - - verify: `node tests/e2e.mjs 2>&1 | grep -q "33/33 PASS" && grep -q "flow-h2-pre" src/styles/tokens.css && grep -q "focus-ring\|focus-visible" src/styles/global.css` +- [ ] T7 版式基底(K/L/O 卡:流距 token+灰阶补档+暗色 hairline 降档+微交互曲线+focus ring) + - claim: orchestrator(tokens/global 专属车道) + - boundary: tokens.css(--flow-* 流距五变量+灰阶补档评估+--paper 纸色变量);global.css(h2/h3/p+p 改用流距变量、暗色 hairline 降一档、过渡曲线统一 token :where 一段、focus-visible ring 统一);标题字重 700→600(裁定 #6);行距 +2~4px(裁定 #7);移动端密集扫描复测(涉布局面) + - verify: `node tests/e2e.mjs 2>&1 | grep -q "33/33 PASS" && grep -q "flow-h2-pre" src/styles/tokens.css && grep -q "focus-visible" src/styles/global.css` -- [ ] T8 - - id: task_0008 - - title: 首屏 tagline + 图库质感(M/N 卡:身份语+圆角统一+暗色 4% 衬底) - - boundary: src/components/IdCard.astro 或首页身份区、src/components/pages/GalleryPage.astro(stage 暗色衬底+radius 统一) - - verify: `node tests/e2e.mjs 2>&1 | grep -q "33/33 PASS" && grep -q "tagline\|身份" src/pages/index.astro src/components/ -r | head -1` +- [ ] T8 首屏 tagline + 图库质感(M/N 卡:身份语+圆角统一+暗色衬底) + - claim: orchestrator + - boundary: 首页身份区(IdCard 或等位组件)加 tagline ≤20 字(措辞备两案入完成总结供用户选,默认「写作者 · 读者 · 快门按压者」);GalleryPage 圆角统一 --radius-img 暗色 4% 衬底(裁定 §6-4 双模式分判;衬底圆角≤照片圆角防框中框);亮色直贴不动 + - verify: `node tests/e2e.mjs 2>&1 | grep -q "33/33 PASS" && grep -rq "tagline" src/pages/index.astro src/components/ && grep -q "radius-img" src/styles/tokens.css` From 22930cfffd44d26765e2f651fe32a856f3f4d880 Mon Sep 17 00:00:00 2001 From: wait4xx Date: Sun, 1 Nov 2026 09:06:54 +0800 Subject: [PATCH 03/13] =?UTF-8?q?feat(seo):=20robots.txt=20=E4=B8=8E=20SEO?= =?UTF-8?q?=20=E8=A7=A3=E5=B0=81=E6=93=8D=E4=BD=9C=E5=8D=95=EF=BC=88blog-5?= =?UTF-8?q?f=20T1=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit robots 404 补齐(Allow 全站/Disallow admin+draft/Sitemap 行); 操作单三步走:nginx snippet 剥 noindex+内部 vhost 补回+admin 局部 保留、ESA purge+TTL+绕缓存、curl 三验证——用户侧执行入口。 验证: T1 verify 命令全过(robots 三断言+操作单节存在) Spec: 2026-10-26_blog-5f Co-authored-by: GLM-5.3 --- docs/上线检查单.md | 25 +++++++++++++++++++++++++ public/robots.txt | 9 +++++++++ 2 files changed, 34 insertions(+) create mode 100644 public/robots.txt diff --git a/docs/上线检查单.md b/docs/上线检查单.md index d232dfb..7d4332a 100644 --- a/docs/上线检查单.md +++ b/docs/上线检查单.md @@ -36,3 +36,28 @@ sudo bash infra/deploy/rollback.sh --exec # 秒级回 Halo - 新文章工作流:本地或 gitea web 写 md → push main → webhook 自动构建发布 - 新照片:上传 content/photos/ 后跑 `python3 scripts/photos_ingest.py` 再 commit - 翻译:新文章 push 后跑 `python3 scripts/translate/translate_posts.py`(幂等) + +--- + +## SEO 解封操作单(Phase 5f T1,2026-10-26 立案) + +**背景**:生产全站自上线起带 `X-Robots-Tag: noindex`(/etc/nginx/snippets/esa-origin-ssl.conf:11 共享片段误伤博客 vhost)+ robots.txt 404 + ESA 将带 noindex 的响应头缓存 30 天——搜索引擎全站不可见。 + +**第一步:nginx(需 sudo)** +1. 编辑 `/etc/nginx/snippets/esa-origin-ssl.conf`:删除第 11 行 `add_header X-Robots-Tag noindex always;`(改前备份 .bak) +2. 给确实需要 noindex 的内部服务 vhost(api/oj/token/fc/latex/cpa/git)各 server 块补回该行 +3. 博客 vhost 补局部:`location /admin/ { add_header X-Robots-Tag noindex always; }` +4. `sudo nginx -t && sudo systemctl reload nginx` + +**第二步:ESA 控制台(不做则 noindex 再活 30 天)** +1. 全站 purge `wait4x.online` +2. HTML 边缘 TTL 调 ≤1h(当前 2592000s,靠回源重验证更新——头会固化) +3. 加规则:`/artalk/api/*` 绕过缓存(GET stats 有 Age 头实锤,pv 数字会冻) + +**第三步:验证** +```bash +curl -sI https://wait4x.online/ | grep -ci x-robots-tag # 期望 0 +curl -s https://wait4x.online/robots.txt | head -3 # 期望 User-agent + Sitemap +curl -sI https://wait4x.online/admin/ | grep -ci noindex # 期望 1(局部保留) +``` +仓库侧已就绪:public/robots.txt(本提交);生产 Lighthouse SEO≥95 复测随后入档。 diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..7cc7bd7 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,9 @@ +# wait4x.online —— 搜索引擎指引(Phase 5f T1) +# 背景:上线期 nginx 共享 snippet 误注全站 noindex,本文件随 SEO 解封三件套落地 +# (docs/上线检查单.md「SEO 解封操作单」;robots 曾长期 404) +User-agent: * +Allow: / +Disallow: /admin/ +Disallow: /draft/ + +Sitemap: https://wait4x.online/sitemap-index.xml From 8ec1712135cb94888d016db31c68aea8822aa32d Mon Sep 17 00:00:00 2001 From: wait4xx Date: Sun, 1 Nov 2026 09:09:27 +0800 Subject: [PATCH 04/13] =?UTF-8?q?feat(5f):=20reader=20=E6=A8=A1=E5=BC=8F+?= =?UTF-8?q?=E7=89=88=E5=BC=8F=E5=9F=BA=E5=BA=95+=E9=A6=96=E5=B1=8F=20tagli?= =?UTF-8?q?ne+=E5=9B=BE=E5=BA=93=E8=B4=A8=E6=84=9F=EF=BC=88T4/T7/T8?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - T4 reader:html.reader 单 class(去装饰非去内容:隐辉光/图标 钮/pv 行,ICP 合规底线永留;正文字号+1px 行宽 56ch;入场动效 关);命令面板 reader 命令+r 键+localStorage;ThemeScript 预绘 防闪 - T7 基底:--flow-* 五流距变量双轨应用;暗色 hairline 降档; 页面标题 700→600(裁定 #6 减字重不减号);focus-visible ring 统一;列表行距 +2px;--paper/--radius-img/--ease-out 入库 - T8:首页 IdCard slot 落 tagline「写作者 · 读者 · 快门按压者, 拥抱开源。」;图库暗色 4% 轻衬底+圆角统一(裁定 #4 双模式分判) 验证: E2E 33/33;reader r 键触发+辉光 none+刷新保持实测;流距 computed 0.6em 实算;tagline 渲染实测 Spec: 2026-10-26_blog-5f Co-authored-by: GLM-5.3 --- src/components/CommandPalette.astro | 10 ++++++++++ src/components/ThemeScript.astro | 4 +++- src/components/geek/Keyboard.astro | 7 +++++++ src/components/pages/GalleryPage.astro | 9 +++++++++ src/i18n/ui.ts | 1 + src/pages/index.astro | 9 ++++++++- src/styles/global.css | 26 ++++++++++++++++++++++++++ src/styles/tokens.css | 17 ++++++++++++++++- 8 files changed, 80 insertions(+), 3 deletions(-) diff --git a/src/components/CommandPalette.astro b/src/components/CommandPalette.astro index 889e6a0..4e3a91a 100644 --- a/src/components/CommandPalette.astro +++ b/src/components/CommandPalette.astro @@ -39,6 +39,10 @@ const navItems = [