Upgrade to Docusaurus 3, standardize on Yarn, improve SEO, and invalidate stale 2.x translations - #532
Merged
Merged
Conversation
… 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
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.
A combined modernization pass on the docs site. All
yarn buildoutput verified across the default version and all 7 locales.Docusaurus 3 upgrade
@docusaurus/*2.3.1→3.10.1, React 17 → 18, MDX 1 → 3,prism-react-renderer1 → 2 (named-export theme import),clsx/@svgr/webpackbumps.webpackoverridespin 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.onBrokenMarkdownLinksto the v3markdown.hookslocation.{user},<=0.1.0, a stray<) in English, versioned, and locale content so every build compiles.Tooling
yarn.lock, removepackage-lock.json. CI usesyarn install --frozen-lockfile+yarn buildwith yarn caching.20.x→24.x(the deprecated-Node-20 warning);actions/checkout@master→@v4.SEO
urltohttps://docs.flarum.org(wasflarum.org) — this one change corrects canonical,og:url, the sitemap domain, and hreflang across the whole site.themeConfig.image(Flarum banner) →og:image/twitter:image(summary_large_image).WebSite/OrganizationJSON-LD viaheadTags.TechArticle+BreadcrumbListJSON-LD for rich search results, via a small localpostBuildplugin (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.
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.code.json, and theme/UI translations.crowdin.ymlso it isn't regenerated; re-enable to resume 2.x translation from current English.Notes