Files
Genarrative/docs/technical/【SEO】官网SEO地基实施约定-2026-07-10.md
T
kdletters 09fec601b1 完善官网 SEO 地基与精确路由
补充 robots、sitemap、SEO 元信息、结构化数据与首页语义内容
统一三套 Nginx 与 Pingora 的 62 条 SPA 路由和真实 404 行为
新增路由一致性检查、网关测试并同步技术文档与项目记忆
2026-07-10 12:14:44 +08:00

2.6 KiB

官网 SEO 地基实施约定

更新时间:2026-07-10

本轮边界

本轮只建立陶泥儿中文首页的 SEO 基础设施,不新增英文站、长尾落地页、SSR、动态 sitemap、前端访问埋点或分享图。

  • public/robots.txt 是真实静态文件;非 SEO 产品路径本轮阻止抓取,但不把 Disallow 解释为保证不收录。
  • public/sitemap.xml 本轮只包含 https://www.genarrative.world/,不写难以持续维护的 lastmod
  • index.html 提供首页 title、description、canonical、robots、基础 OG/Twitter 文本和 JSON-LD;没有正式分享图时不写 og:imagetwitter:image 或 JSON-LD logo
  • 首页渲染后只有一个稳定、可见的产品定位 H1;动态作品名、卡片标题、按钮内部标题和隐藏 Tab 不作为 H1。
  • Nginx 和 Pingora 只对当前已知完整 SPA 路径回退 index.html;未知路径以及 /creation/not-exist 等同前缀未知路径返回 HTTP 404。
  • Nginx access log 继续使用现有 $http_referer,本轮不新增前端 pageview 或用户身份采集。

路由事实源

主站 SPA 路由以以下源码为事实源:

  • src/routing/appRoutes.tsx
  • src/routing/appPageRoutes.ts

/creation/rpg/agent 仍被现有刷新恢复链路使用,当前作为兼容深链保留。新增或删除前端路由时,必须同步三套 Nginx 配置、Pingora 路由、deploy/pingora/nginx-route-parity.matrix.json 和对应自动门禁。不得把 /creation/*/runtime/* 等一级目录整体设为 SPA fallback。

后续新增 SEO 落地页时,还必须同时满足:返回 200、不被 robots.txt 阻止抓取、加入 sitemap,并提供独立 title、description、canonical、H1、正文和内链入口。纯 SPA 页面需要独立 head 时,应评估构建时静态 HTML、预渲染或 SSR。

验收口径

npm run build
npm run typecheck
npm run check:nginx-spa-routes
npm run check:pingora-route-parity
npm run check:pingora-gateway-smoke
npm run check:encoding
git diff --check

部署后至少验证:

curl -I https://www.genarrative.world/robots.txt
curl -I https://www.genarrative.world/sitemap.xml
curl -I https://www.genarrative.world/not-exist-test
curl -I https://www.genarrative.world/creation/not-exist-test
curl -I https://www.genarrative.world/runtime/not-exist-test
curl -I https://www.genarrative.world/puzzle/not-exist-test

真实 SPA 路径不得误 404;以上未知路径必须返回 404。首页浏览器 DOM 应只有一个 H1,并确认桌面和移动端布局、导航、推荐流和创作入口没有因 SEO 文案变形。