Skip to Content
Migrate

Migrate from @fumadocs/astro

Move a site from the managed setup of @fumadocs/astro 0.1.

The managed setup of @fumadocs/astro 0.1, with src/fumadocs.config.ts, is now @fumapress/astro. Do the steps in order.

Migration Steps

Install the Packages

npm i @fumapress/astro
npm i @fumadocs/astro@latest takumi-js fumadocs-core@latest
npm i fumadocs-ui@npm:@fumadocs/base-ui@latest

Update the Integration

Your layout and page modules move out of the integration. If you have them, see Migrating Features.

astro.config.mjs
import fumadocs from "@fumadocs/astro";
import press from "@fumapress/astro";

export default defineConfig({
  integrations: [
    fumadocs({
      components: "./src/components/mdx.tsx",
      layout: "./src/lib/layout.shared.tsx",
      page: "./src/components/docs.tsx",
    }),
    press({
      components: "./src/components/mdx.tsx",
    }),
  ],
});

Move the Config

Replace src/fumadocs.config.ts and src/lib/source.ts with one file at the project root. The source is passed directly to createPress(), and baseUrl becomes baseDir.

import { getCollection } from "astro:content";
import { toFumadocsSource } from "@fumadocs/astro/source";
import { createPress } from "@fumapress/astro/config";

export const app = createPress(
  toFumadocsSource(await getCollection("docs"), await getCollection("meta"), {
    baseDir: "docs",
  }),
);

export default app.config({
  site: { name: "My Docs" },
});

Rename the Stylesheet

Move src/styles/global.css to src/app.css. This file replaces the css option. @fumapress/astro/css/default.css has the Tailwind and Fumadocs imports:

src/app.css
@import "tailwindcss";
@import "fumadocs-ui/css/neutral.css";
@import "fumadocs-ui/css/preset.css";
@import "@fumapress/astro/css/default.css";

Run the Site

npm run dev

If you didn't customize your site, you're done. Otherwise, open the section for each feature you use.

Migrating Features

Last updated on

On this page