Migrate from Docusaurus
Docusaurus is already Markdown- and MDX-based, so most prose, headings, code fences, and local assets can move directly. The main work is translating sidebars, Docusaurus-only components, versioned routes, and plugin behavior.
Start with the repository
Migrate from the Docusaurus source repository, not rendered HTML. The repository preserves frontmatter, sidebar IDs, imports, version folders, and original asset paths.
1. Inventory the source
Record these inputs before editing:
docusaurus.config.js,.ts,.mjs, or.mtssidebars.js,.ts, or generated sidebar definitions- every
@docusaurus/plugin-content-docsinstance and itspathandrouteBasePath docs/,static/,src/components/, andsrc/css/versions.json,versioned_docs/, andversioned_sidebars/- locale folders under
i18n/ - redirects, Algolia, analytics, OpenAPI, and custom plugins
2. Map the files
| Docusaurus | Farming Labs Docs |
|---|---|
docs/**/*.mdx | Target docs content tree |
sidebars.* | File order, order frontmatter, and folder structure |
docusaurus.config.* | docs.config.ts plus host/runtime configuration |
static/** | Target public/static directory |
src/components/** | Registered MDX components or plain Markdown replacements |
src/css/custom.css | Target global CSS or theme overrides |
versioned_docs/** | Explicit version folders or a maintained current-version subset |
i18n/**/docusaurus-plugin-content-docs/** | Locale content roots configured for the target |
For Next.js, each migrated route uses app/docs/**/page.mdx or src/app/docs/**/page.mdx. The
other adapters read Markdown or MDX from the configured contentDir.
3. Preserve slugs and frontmatter
Docusaurus commonly derives a route from id, slug, the filename, and the plugin route base.
Build a route list before moving files. Keep these fields when they still describe content:
titledescriptionsidebar_label→titlewhen it is the preferred navigation labelsidebar_position→ordertags- explicit
slug, represented by the destination file path whenever possible
Review Docusaurus-only fields such as pagination_next, pagination_prev, toc_min_heading_level,
toc_max_heading_level, hide_table_of_contents, and draft. Recreate the desired behavior in
Farming Labs config or remove the field intentionally.
4. Translate sidebars
Farming Labs Docs builds its default sidebar from the content tree. Recreate each Docusaurus
category as a directory and give pages numeric order values matching the source order.
docs/
├── getting-started/
│ ├── index.mdx
│ ├── installation.mdx
│ └── configuration.mdx
└── reference/
└── api.mdxUse folder landing pages for category introductions. External sidebar links belong in the application navigation or a custom sidebar. Generated and dynamic sidebar functions require an explicit snapshot or an equivalent custom navigation implementation.
5. Convert Docusaurus MDX
| Docusaurus syntax | Target |
|---|---|
:::note, :::tip, :::warning, :::danger | Built-in Markdown directive support or <Callout> |
@theme/Tabs and @theme/TabItem | <Tabs> and <Tab> |
@docusaurus/Link | Standard Markdown links or the target runtime link component |
@site/static/... | Public-root asset URL |
require(...) inside MDX | Static import supported by the target, or a public asset URL |
| Swizzled theme component | Farming Labs theme configuration or a registered custom component |
Remove Docusaurus imports only after replacing every corresponding JSX use. For a custom component
that should survive, register it under components in docs.config.ts.
6. Handle versions and locales
Docusaurus stores frozen versions in versioned_docs/version-<name>/ and matching navigation in
versioned_sidebars/. Choose one policy:
- Current only: migrate
docs/and redirect or archive older versions. - Supported versions: place each maintained version under an explicit route such as
/docs/v2/.... - Separate deployments: keep old Docusaurus versions online while new documentation moves.
Do not silently collapse multiple versions into one route. Apply the same explicit decision to
each locale under i18n/.
7. Recreate integrations
Translate these independently from content:
- Algolia or another search provider →
search - OpenAPI plugins →
apiReference - redirects → target host/runtime redirects
- analytics →
analyticsor the target provider - custom head tags → application metadata
- authentication → application middleware plus opt-in agent endpoint authentication
Docusaurus blog, custom React pages, and plugin-generated application routes are outside the docs content migration and should have their own owner.
8. Validate and recover
- Run the target production build.
- Compare the source and target route lists, including version and locale prefixes.
- Open pages containing tabs, admonitions, imported components, diagrams, and relative images.
- Check sidebar order, collapsed groups, previous/next links, and mobile navigation.
- Fetch several migrated pages through their
.mdroutes. - Keep redirects and the source deployment until production traffic is verified.
If compilation fails, isolate the first source-only import and replace it before continuing. If a route changes, prefer restoring the old path; otherwise add a permanent redirect and test its destination.
Source references
Migrate Docusaurus docs, sidebars, versions, components, and assets to Farming Labs Docs
How is this guide?