Skip to content

feat: serve blog, learning center, and articles from the static build (wave 2)#2075

Merged
moonming merged 1 commit into
masterfrom
feat/astro-wave2
Jul 23, 2026
Merged

feat: serve blog, learning center, and articles from the static build (wave 2)#2075
moonming merged 1 commit into
masterfrom
feat/astro-wave2

Conversation

@moonming

@moonming moonming commented Jul 23, 2026

Copy link
Copy Markdown
Member

What

Wave 2 of the incremental migration in next/MIGRATION.md (wave 1 = the landing pages, #2073): the /blog/ (EN+ZH, ~735 URLs), /learning-center/, /articles/, and /events/archive/ subtrees are now produced by the zero-JS Astro build. Every other URL — docs, plugins, team, downloads — is still produced by Docusaurus, byte-identical.

These subtrees were chosen because their markdown lives in this repo: the Astro step syncs it straight from the checkout, no external fetches, and the build stays fast (~13 s for 924 pages).

Deploy pipeline

  • Parity gate (new): before overlaying, CI asserts every URL Docusaurus produced under a migrated prefix also exists in the Astro build, and fails the deploy otherwise. Stronger than sitemap-level parity — it checks the real build output.
  • Overlay allowlist extends from index.html, zh/index.html, _astro, img to the wave-2 subtrees (whole-subtree replacement).
  • Feeds stay alive: Docusaurus' RSS/atom feeds for learning-center/articles (8 files) are carried into the Astro tree before the swap, byte-identical.

Old React homepage removal

The / route has been produced by Astro since wave 1, but the React homepage stayed inside the website workspace's bundle — so a client-side navigation to / (e.g. clicking the navbar logo from /plugins/) rendered the stale page. This PR:

  • removes website/src/pages/index.tsx + its section components and landing styles (Video.tsx/video.css and HeroCanvas.tsx are pre-existing unreferenced code, left as-is)
  • sets all four workspaces' navbar logos to href: 'pathname:///' with target: '_self' — the Link resolver injects target="_blank" on pathname:// URLs otherwise, which is why the repo's existing locale-dropdown usages also pass an explicit target
  • the NotFound pages' "home page" link uses the same treatment (to="/" would dead-end in the SPA now that / is not a client route)
  • patches update-sitemap-loc.js to re-add the / and /zh/ entries the website workspace's sitemap no longer contains (verified against the real sitemap: idempotent, +1 entry, priority 1.0)

Contract & verification

Assembled against the current asf-site tree and asserted:

  • index.html page count unchanged (4306 → 4306)
  • wave-2 subtree URL sets byte-exact vs production: 0 missing, 0 extra (incl. the unicode-quote blog slug and /blog/blog/...; blog tag pages 10 EN + 6 ZH match the production dirs exactly)
  • 8/8 RSS/atom feeds byte-identical
  • all 8,681 files outside the allowlist untouched; sitemap.xml untouched by the overlay
  • head parity on sampled posts: canonical, title, og:type=article, JSON-LD BlogPosting, hreflang — all match production (including the one post whose frontmatter slug starts with / — its leading slash is stripped so the canonical is single-slash, exactly as Docusaurus normalizes it)

Notes for reviewers

  • Blog/learning-center/articles pages keep their exact URLs and <head> shape; the visible chrome is the same header/footer as the wave-1 landing page.
  • /blog/tags/ and /blog/page/ remain robots-disallowed and out of the sitemap, as today.
  • Wave 3 (docs, the largest surface) stays Docusaurus until proposed separately.
  • The parity gate also asserts every non-HTML file under a migrated prefix is either in the Astro tree or in the feed-carry list, so a future feed/config change cannot be dropped silently.
  • Known informational notes: the gate runs on the master deploy (this workflow has no pull_request trigger), so a regression aborts the deploy before publishing rather than failing a PR check; and a wrong WEBSITE_REPO would sync zero posts, which the same gate then catches as hundreds of missing URLs.

@moonming
moonming force-pushed the feat/astro-wave2 branch 4 times, most recently from da13842 to 9f154e0 Compare July 23, 2026 08:23
juzhiyuan
juzhiyuan previously approved these changes Jul 23, 2026
LiteSun
LiteSun previously approved these changes Jul 23, 2026
@moonming
moonming dismissed stale reviews from LiteSun and juzhiyuan via 92a2198 July 23, 2026 08:48
… (wave 2)

Second wave of the incremental migration in next/MIGRATION.md. The
/blog/ (EN+ZH), /learning-center/, /articles/, and /events/archive/
subtrees are now produced by the zero-JS Astro build; every other URL is
still produced by Docusaurus.

Deploy pipeline:
- the Astro step syncs blog/learning-center/articles markdown from this
  very checkout (WEBSITE_REPO env) before building — no external fetches
- a parity gate fails the deploy if any URL Docusaurus produced under a
  migrated prefix is missing from the Astro build
- the overlay allowlist extends to the wave-2 subtrees; Docusaurus'
  RSS/atom feeds for learning-center/articles are carried into the tree
  so feed URLs stay alive

Astro pages:
- blog tag pages (10 EN + 6 ZH + index) and per-post tag links, matching
  the production URL set exactly
- article pages emit og:type=article like production

Old homepage removal:
- the React homepage and its section components leave the website
  workspace (the / route is produced by Astro since wave 1; keeping it
  in the bundle showed the stale page on client-side navigations)
- all four workspaces' navbar logos use pathname:/// for a full-page
  navigation to the static homepage
- update-sitemap-loc.js re-adds the / and /zh/ entries the website
  workspace's sitemap no longer contains

Verified against the current asf-site tree: index.html count unchanged
(4306), wave-2 subtree URL sets byte-exact vs production (0 missing, 0
extra), 8/8 feeds byte-identical, all 8681 files outside the allowlist
untouched, sitemap.xml untouched, head parity on sampled posts
(canonical/title/og:type/JSON-LD/hreflang).

NOT for direct merge: needs the usual reviews.
@moonming
moonming merged commit 26c785c into master Jul 23, 2026
4 checks passed
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.

3 participants