Skip to content

Upgrade to Docusaurus 3, standardize on Yarn, improve SEO, and invalidate stale 2.x translations - #532

Merged
imorland merged 1 commit into
mainfrom
im/docs-docusaurus-3-upgrade
Jun 9, 2026
Merged

Upgrade to Docusaurus 3, standardize on Yarn, improve SEO, and invalidate stale 2.x translations#532
imorland merged 1 commit into
mainfrom
im/docs-docusaurus-3-upgrade

Conversation

@imorland

@imorland imorland commented Jun 9, 2026

Copy link
Copy Markdown
Member

A combined modernization pass on the docs site. All yarn build output verified across the default version and all 7 locales.

Docusaurus 3 upgrade

  • @docusaurus/* 2.3.13.10.1, React 17 → 18, MDX 1 → 3, prism-react-renderer 1 → 2 (named-export theme import), clsx/@svgr/webpack bumps.
  • Drops the webpack overrides pin added in Fix broken production docs deploy (webpack ProgressPlugin ValidationError) #529 — no longer needed on v3. The webpackbar/ProgressPlugin schema mismatch that forced the pin doesn't exist on Docusaurus 3.
  • Migrate onBrokenMarkdownLinks to the v3 markdown.hooks location.
  • Escape MDX-v3-breaking literals ({user}, <=0.1.0, a stray <) in English, versioned, and locale content so every build compiles.

Tooling

  • Standardize on Yarn (matches the rest of the Flarum ecosystem): regenerate yarn.lock, remove package-lock.json. CI uses yarn install --frozen-lockfile + yarn build with yarn caching.
  • Workflow Node 20.x24.x (the deprecated-Node-20 warning); actions/checkout@master@v4.
  • README: Node ≥20, Yarn commands, and a new Translations section documenting the Crowdin workflow.

SEO

  • Fix url to https://docs.flarum.org (was flarum.org) — this one change corrects canonical, og:url, the sitemap domain, and hreflang across the whole site.
  • Default social card via themeConfig.image (Flarum banner) → og:image / twitter:image (summary_large_image).
  • Site-level WebSite/Organization JSON-LD via headTags.
  • Per-page TechArticle + BreadcrumbList JSON-LD for rich search results, via a small local postBuild plugin (plugins/structured-data) — no theme swizzle, works across all locales, upgrade-safe. Injects into all 148 pages per build.
  • onBrokenAnchors: 'warn' (surfaces ~9 pre-existing broken in-page anchors).

Translations — 2.x invalidated

The 2.x (current) translations for all 6 locales were frozen at a Dec-2024 snapshot, ~18 months and 40+ commits behind English, and translated content that has since been corrected (e.g. the pre-Symfony Swiftmailer mail-driver API). With Crowdin dormant (~19 months of unmerged sync PRs), there was no path to fix them, and serving confidently-wrong localized 2.x docs at the 2.0 launch is worse than falling back to English.

  • Removed i18n/<locale>/docusaurus-plugin-content-docs/current/ for all locales (~450 files). Docusaurus automatically falls back to English for untranslated 2.x pages — no 404s.
  • Kept 1.x doc translations, code.json, and theme/UI translations.
  • Commented out the 2.x source mapping in crowdin.yml so it isn't regenerated; re-enable to resume 2.x translation from current English.

Notes

  • The default docs version (currently 1.x) is intentionally not switched to 2.x here — that's deferred to the 2.0 stable release.
  • JSON-LD is now present where Docusaurus emits none by default; verified parseable.

… stale 2.x translations

Docusaurus 3 upgrade:
- @docusaurus/* 2.3.1 -> 3.10.1, React 17 -> 18, MDX 1 -> 3,
  prism-react-renderer 1 -> 2 (named-export theme import), clsx/@svgr bumps
- drop the webpack 5.88.2 `overrides` pin (no longer needed on v3; the
  webpackbar/ProgressPlugin schema mismatch that forced it is gone)
- migrate onBrokenMarkdownLinks to markdown.hooks (v3 location)
- escape MDX-v3-breaking literals ({user}, <=0.1.0, stray <) in English,
  versioned, and locale content so all 7 builds compile

Tooling:
- standardize on Yarn (regenerate yarn.lock, remove package-lock.json);
  CI uses `yarn install --frozen-lockfile` + `yarn build` with yarn cache
- bump workflow Node 20 -> 24; pin actions/checkout to @v4
- README: Node >=20, Yarn commands, and a Translations section documenting
  the Crowdin workflow

SEO:
- fix `url` to https://docs.flarum.org (was flarum.org) — corrects
  canonical, og:url, sitemap domain, and hreflang across the site
- set themeConfig.image to a Flarum banner for og:image/twitter:image
- site-level WebSite/Organization JSON-LD via headTags
- per-page TechArticle + BreadcrumbList JSON-LD via a local postBuild
  plugin (no theme swizzle; works across all locales)
- onBrokenAnchors: 'warn'

Translations:
- invalidate the 2.x (current) translations for all locales: they were
  frozen at a Dec-2024 snapshot, ~18 months and 40+ commits behind, and
  translated since-corrected content (e.g. the pre-Symfony mail API).
  Docusaurus falls back to English for untranslated 2.x pages.
- 1.x translations, code.json, and theme translations are kept
- disable the 2.x source mapping in crowdin.yml so it isn't regenerated
@imorland
imorland merged commit ea2a9d8 into main Jun 9, 2026
1 check passed
@imorland
imorland deleted the im/docs-docusaurus-3-upgrade branch June 9, 2026 16:15
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