20260921-1659-post-migration-follow-ups Resolve the Astro migration follow-ups
- status: completed
- createdAt: 2026-09-21 16:59
- approvedAt: 2026-09-21 16:59
- relatedTask: 20260921-1659-post-migration-follow-ups
Context
章节标题:“Context”Items investigated against the tree before planning. Two need no change:
- Starlight's ranking defaults are already replaced:
pagefind.rankinghas been in astro.config.mjs since the site-shell workstream. The closing note that called it open was stale. - The two manuals over 25 MiB do not 404. No page links them; the source catalog cites the repository originals as code spans and links the publisher PDFs.
Proposal
章节标题:“Proposal”- Trailing-slash hops. After
html_handling: drop-trailing-slash, 31 directory URLs still carry a slash in 9943 in-site hrefs, each costing a redirect. Emit them slashless at every source:src/lib/site-tree.tsdirectory links,idToHreffor index pages, a normalisation inrewriteDocLinksfor authored absolute links to a published directory, the two slash-ended_redirectstargets, and the three hero links in the rootindex.md. Target: 0 internal slash-ended hrefs. siteandtrailingSlash: 'never', enabling sitemap.xml and canonical links for https://ybo-docs.cfaa.workers.dev. Every sitemap URL must answer 200 with no redirect.- Align the workflow's
wranglerVersionwith the 4.131.2 devDependency. - Repair the three malformed external links in content: two exhibitor rows carrying two URLs in one destination, and a bare URL run into full-width punctuation.
- A
lint-docs.mjsrule for bare HTML tags in prose, which render as nothing. Must pass today and be shown to fire. - A placeholder site icon, replacing the favicon-link strip.
- External content links open in a new tab with
rel="noreferrer", as VitePress did. - Translate Starlight's heading-anchor label, shipped untranslated in its zh-CN strings, through
a
src/content/i18n/zh-CN.jsonoverride. - Re-measure Chinese search recall on the shipped ranking with the preserved harness.
Risks
章节标题:“Risks”Item 1 changes the emitted form of 31 directory URLs; slashed forms still resolve through the asset handler, so no published URL breaks. Item 2 publishes canonical URLs naming the workers.dev host; one line to change when a custom domain exists. Item 6 is a placeholder, not a brand mark.
Scope
章节标题:“Scope”Code: astro.config.mjs, src/lib/site-tree.ts, src/doc-urls.ts, src/content.config.ts, src/components/Head.astro, new plugin/i18n/icon files, public/_redirects, scripts/lint-docs.mjs, .github/workflows/deploy.yml. Content: root index.md hero links and three table cells.
Alternatives
章节标题:“Alternatives”Item 1 could stop at the asset handler and accept one hop per directory link; rejected because the sidebar puts roughly 31 such links on every page.
Annotations
章节标题:“Annotations”2026-09-21 16:59: Approved by the owner ("全部处理").