Skip to content

feat(pages): edit.chaxus.com 跳转器(带参数,草稿·CF 上线后再合)#101

Merged
chaxus merged 4 commits into
mainfrom
feat/redirect-edit-chaxus
Jul 5, 2026
Merged

feat(pages): edit.chaxus.com 跳转器(带参数,草稿·CF 上线后再合)#101
chaxus merged 4 commits into
mainfrom
feat/redirect-edit-chaxus

Conversation

@chaxus

@chaxus chaxus commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

⚠️ 草稿 / DO NOT MERGE:edit.chaxus.com(Cloudflare Pages)确认上线之前不可合并。提前激活会把用户导去尚不存在的站。

这是什么

document 迁 edit.chaxus.com 后,旧地址 ranuts.github.io/document/*跳转器(准备件)。github.io 只能客户端跳转(JS location.replace + canonical,Google 视同 301)。

内容

  • redirect/index.html + redirect/404.html(内容一致;GH Pages 对未匹配路径回 404.html)
  • pages-build-site.yml:去掉 app 构建,只 upload ./redirect;加 workflow_dispatch 便于 CF 上线后手动首发

跳转核心:剥掉 /document 前缀,保留 path + query + hash——编辑器靠 ?embed=/?agent=1/?url=/?embedOrigin= 驱动,query 不能丢。

附带结论:document 已经 base 无关

核实发现 ran 那套「base /document//」根路径化对 document 不需要:vite base './' + 运行时 getBasePath()(根域 pathname / 自动返回 /)+ manifest/SW 全相对。→ planning 决策 6 的"必做代码工"整条勾销。

验证

  • 6 个 node 用例:path 剥离 + query + hash 组合全对
  • Playwright 真浏览器:拦截 ranuts.github.io/document/*,捕获实际跳转目标 —— embed / agent&url / 深层路径+hash 全部正确

激活顺序(合并前先做 CF)

  1. 先上 edit.chaxus.com(CF *.pages.dev 验证 OK)
  2. 合并本 PR(别删 workflow,否则旧站冻结→重复内容)
  3. workflow_dispatch 手动首发,验证旧链接跳转
  4. GSC 地址变更 / sitemap / 外链

待你确认:workflow 触发分支现为 release/v0.0.4,激活时需确认改动落到该分支或调整。

详见 docs/explorations/2026-07-05-github-pages-redirector.md

🤖 Generated with Claude Code

chaxus and others added 4 commits July 5, 2026 19:03
…ving)

Prepares the old-site redirector for the edit.chaxus.com migration. Publishes
only redirect/{index,404}.html via GitHub Pages; a client-side location.replace
(+ canonical, which Google treats as a soft 301) sends ranuts.github.io/document/*
to edit.chaxus.com/*, stripping the /document base and preserving path + query
+ hash. Query preservation is mandatory — the editor is driven by ?embed= /
?agent=1 / ?url= / ?embedOrigin=.

- redirect/index.html + redirect/404.html
- pages-build-site.yml: drop the app build, upload ./redirect; add
  workflow_dispatch for manual first deploy once Cloudflare is live

Also confirmed document is already base-agnostic (vite base './' + runtime
getBasePath + relative manifest/SW), so no /document -> / rootification is
needed — that planned task collapses to zero.

Verified: 6 node cases + Playwright real-browser interception confirm the
destination URL strips /document and keeps the query across embed/agent/url.

DO NOT MERGE until edit.chaxus.com is confirmed live — activating early would
redirect users to a site that does not yet exist.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
CF Pages now serves the app from main, so the GitHub Pages redirector is
main-based too — merging #101 to main activates it (guarded by draft status
until edit.chaxus.com is live).
@chaxus chaxus marked this pull request as ready for review July 5, 2026 11:35
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 5, 2026

Copy link
Copy Markdown

Deploying document with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5452254
Status: ✅  Deploy successful!
Preview URL: https://bc5f4748.document-7hm.pages.dev
Branch Preview URL: https://feat-redirect-edit-chaxus.document-7hm.pages.dev

View logs

@chaxus chaxus merged commit c18ce50 into main Jul 5, 2026
4 checks passed
chaxus added a commit that referenced this pull request Jul 5, 2026
CF Pages now serves the app from main, so the GitHub Pages redirector is
main-based too — merging #101 to main activates it (guarded by draft status
until edit.chaxus.com is live).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant