Home /

docs

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 .mts
  • sidebars.js, .ts, or generated sidebar definitions
  • every @docusaurus/plugin-content-docs instance and its path and routeBasePath
  • docs/, static/, src/components/, and src/css/
  • versions.json, versioned_docs/, and versioned_sidebars/
  • locale folders under i18n/
  • redirects, Algolia, analytics, OpenAPI, and custom plugins

2. Map the files

DocusaurusFarming Labs Docs
docs/**/*.mdxTarget 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.cssTarget 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:

  • title
  • description
  • sidebar_label → title when it is the preferred navigation label
  • sidebar_position → order
  • tags
  • 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.

example target structure
docs/
├── getting-started/
│   ├── index.mdx
│   ├── installation.mdx
│   └── configuration.mdx
└── reference/
    └── api.mdx

Use 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 syntaxTarget
:::note, :::tip, :::warning, :::dangerBuilt-in Markdown directive support or <Callout>
@theme/Tabs and @theme/TabItem<Tabs> and <Tab>
@docusaurus/LinkStandard Markdown links or the target runtime link component
@site/static/...Public-root asset URL
require(...) inside MDXStatic import supported by the target, or a public asset URL
Swizzled theme componentFarming 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:

  1. Current only: migrate docs/ and redirect or archive older versions.
  2. Supported versions: place each maintained version under an explicit route such as /docs/v2/....
  3. 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 → analytics or 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

  1. Run the target production build.
  2. Compare the source and target route lists, including version and locale prefixes.
  3. Open pages containing tabs, admonitions, imported components, diagrams, and relative images.
  4. Check sidebar order, collapsed groups, previous/next links, and mobile navigation.
  5. Fetch several migrated pages through their .md routes.
  6. 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

Customize
Live preview on these docs
Reset
Customize
Export Code
Preset
Explore more themes
Primary Color
Primary
Colors
Background
Foreground
Muted Text
Border
Card
Muted BG
Ring
Layout
SidebarBordered
TOC StyleDirectional (tree)
TOC DepthH2 + H3
Ask AI
ModeFloating
Floating StyleFull Modal
PositionBottom Right
Features