跳转到内容

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

Items investigated against the tree before planning. Two need no change:

  • Starlight's ranking defaults are already replaced: pagefind.ranking has 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.
  1. 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.ts directory links, idToHref for index pages, a normalisation in rewriteDocLinks for authored absolute links to a published directory, the two slash-ended _redirects targets, and the three hero links in the root index.md. Target: 0 internal slash-ended hrefs.
  2. site and trailingSlash: 'never', enabling sitemap.xml and canonical links for https://ybo-docs.cfaa.workers.dev. Every sitemap URL must answer 200 with no redirect.
  3. Align the workflow's wranglerVersion with the 4.131.2 devDependency.
  4. 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.
  5. A lint-docs.mjs rule for bare HTML tags in prose, which render as nothing. Must pass today and be shown to fire.
  6. A placeholder site icon, replacing the favicon-link strip.
  7. External content links open in a new tab with rel="noreferrer", as VitePress did.
  8. Translate Starlight's heading-anchor label, shipped untranslated in its zh-CN strings, through a src/content/i18n/zh-CN.json override.
  9. Re-measure Chinese search recall on the shipped ranking with the preserved harness.

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.

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.

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.

2026-09-21 16:59: Approved by the owner ("全部处理").