Repository navigation
域名收敛单一真源 + canonical 改用 workerhub.github.io - #19
Merged
todosdev[bot] merged 2 commits intoNov 9, 2026
Merged
Conversation
`astro.config.ts` 的 `site`、4 处 User-Agent、构建摘要标签、canonical/og/sitemap/robots 全部从 `src/lib/site.ts` 的 `SITE.url` 派生;新增守卫测试断言完整字面量只出现在真源一处。 部署线称谓对调:GitHub Pages = 主站,Cloudflare = 副线;推翻 SPEC §10 旧口径(副线继续 serving 同一份产物,不再 canonical),部署通道与绑定设置未改。 README/CONTRIBUTING、工作流注释与 `astro.config.ts` 的 tsconfig 覆盖同步。
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://tds-conv-01a1beed-badb-7139-b5ee-ea9746b548b7-workerhub.pama.workers.dev (commit ae7817d)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/lib/site.ts的SITE.url改为https://workerhub.github.io,全仓只保留这一份完整域名字面量;astro.config.mjs→astro.config.ts,其site改为从SITE.url派生,不再是第二份字面量。og:url/og:image/ sitemap<loc>/ robotsSitemap:一律指向workerhub.github.io;hub.oneboy.app退为副线,继续 serving 同一份产物,只是不再作 canonical。wrangler.jsonc的 Worker 名hub与产物目录等冻结契约保持不变。Changes
单一真源与构建配置
src/lib/site.ts:SITE.url改为新域名,注释改为「唯一定义处,配置/页面/端点/库/脚本一律派生」。astro.config.mjs→astro.config.ts:site: SITE.url(import真源),其余配置逐字保留;tsconfig.json把新配置文件纳入astro check。绝对地址的派生消费方
${SITE.url},产品名与(+…)形态不变:scripts/fetch-og-images.ts、src/lib/github-meta.ts、src/lib/link-health.ts、src/lib/submission-checks.ts。src/lib/build-summary.ts:部署线标签对调为「GitHub Pages 主站(<真源主机名>)」/「Cloudflare Pages 副线」,摘要首句同步;主机名由真源派生,不另写字面量。部署线称谓(不改行为)
.github/workflows/deploy.yml:头注释 ①/② 对调,两个发布 job 的显示名与相关 step 名、成功 echo 同步;job id、needs、environment、Secrets 引用与容错逻辑未动。wrangler.jsonc首行注释标注为副线。文档与注释
README.md(主站 / 副线)、CONTRIBUTING.md(站点主域名,会注入/submit/页)、src/layouts/base-layout.astro、src/pages/sitemap.xml.ts、src/pages/robots.txt.ts、src/lib/build-info.ts及对应测试的注释措辞,全仓已无「镜像」残留。测试
tests/site-single-source.test.ts:以SITE.url本身作扫描串,扫src/、scripts/、tests/与根目录astro.config.*,断言完整字面量只出现在src/lib/site.ts—— 把验收 grep 变成 CI 常驻守卫。tests/build-summary.test.ts、tests/build-info.test.ts的标签与称谓断言同步。Testing
pnpm test:137 项,通过 136、失败 0、跳过 1(既有的、需真实 GitHub 网络用例)。pnpm lint:astro check65 个文件 0 error / 0 warning,prettier --check全通过。pnpm build(与 CI 同一条命令,真实抓取):仓库抓取 11/11 成功,24 页构建完成。https://workerhub.github.io/…,og:url/og:image0 例外;sitemap 23 条<loc>全部新域名;/robots.txt为Sitemap: https://workerhub.github.io/sitemap.xml;dist/内hub.oneboy.app零命中。hub.oneboy.app在src/、scripts/、tests/、astro.config.*零命中;完整字面量只剩src/lib/site.ts一处。https://example.com→ 重建 → canonical、sitemap<loc>、robots 同步变为 example.com,代码无需第二处修改 → 恢复真源重建,产物回到新域名。Notes
hub.oneboy.appvs 代码里该域名零出现),本 PR 按可执行的验收执行:标签只写「Cloudflare Pages 副线」,副线域名保留在 README 与deploy.yml/wrangler.jsonc注释(不在 grep 范围)。deploy.yml两个发布 job 的显示名随称谓对调;若main的分支保护把旧名字设为「必需检查」,合并前需把必需检查改成新名字(仓库设置属用户侧,本 PR 未动)。