Skip to Content
Migrate

Migrate from Mintlify

Run your Mintlify docs on Fumapress, using your docs.json.

@fumapress/mintlify reads your docs.json and configures the navigation, theme, navbar and more from it. It covers docs.json only. Your content source handles the MDX, including Mintlify components like <Card> and <Accordion>.

Setup

Install

npm i @fumapress/mintlify

Move Your Files

Keep docs.json at your project root, and move your MDX pages to content/docs. Paths in docs.json are resolved against that folder, and a docs/ or content/docs/ prefix in navigation entries is ignored.

Add the Plugin

press.config.tsx
import { createPress } from "fumapress";
import { defineDocs } from "fumadocs-mdx/macro";
import { mintlifyPlugin } from "@fumapress/mintlify";

const docs = defineDocs({ dir: "content/docs" });

export default createPress({ docs: docs.toFumadocsSource() })
  .plugins(mintlifyPlugin());

Your ui.layoutProps and ui.providerProps take priority over docs.json.

Customization

Feature Toggles

Everything is on by default. Turn off a feature to configure it yourself. This example turns off search:

press.config.tsx
mintlifyPlugin({
  // relative to the project root
  path: "docs.json",
  // the docs folder inside `content/`
  docsDir: "docs",
  features: {
    navigation: true,
    navbar: true,
    theme: true,
    appearance: true,
    banner: true,
    footer: true,
    redirects: true,
    notFound: true,
    search: false, 
    metadata: true,
  },
});

404 Page

errors.404 creates a page with the type mintlify.404. Restyle it in renderPage:

press.config.tsx
createPress(content)
  .plugins(mintlifyPlugin())
  .config({
    ui: {
      renderPage(props) {
        if (props.type === "mintlify.404") return <main>{props.title}</main>;
        return props.renderDefault();
      },
    },
  });

Languages

When docs.json defines navigation.languages, create the i18n config from it:

press.config.tsx
import { defineMintlifyI18n, mintlifyPlugin, readMintlifyDocs } from "@fumapress/mintlify";

const mintlifyDocs = readMintlifyDocs();
const i18n = defineMintlifyI18n(mintlifyDocs, {
  // optionally map Mintlify locales to your own codes
  localeMap: { cn: "zh" },
});

export default createPress(content, { i18n })
  .plugins(mintlifyPlugin())
  .config({
    ui: { translations: i18n.translations() },
  });

API Pages

Forward api.openapi sources (file paths or URLs) to the OpenAPI plugin:

press.config.tsx
import { mintlifyPlugin } from "@fumapress/mintlify";
import { createMintlifyOpenAPI } from "@fumapress/mintlify/openapi";
import openapiPlugin from "fumadocs-openapi/press";

const openapi = createMintlifyOpenAPI();

export default createPress({
  docs: docsSource,
  openapi: await openapi.staticSource(),
}).plugins(mintlifyPlugin(), openapiPlugin({ server: openapi }));

api.asyncapi works the same way, with createMintlifyAsyncAPI from @fumapress/mintlify/asyncapi and the AsyncAPI plugin.

api.playground.proxy turns the proxy on or off. It is on by default, so the site needs a server. Set it to false on a static site.

docs.json Support

Unsupported properties are accepted and ignored, so they never stop the migration. docs.json can reference other JSON files with $ref, as long as they stay inside your project root.

Last updated on

On this page