Formion LogoMkSaaS文檔
Formion LogoMkSaaS文檔
首頁

介紹

快速入門什麼是 Fumadocs對比

設置

手動安裝靜態導出

寫作

Markdown國際化

UI

概覽主題搜尋
組件
MDX
X (Twitter)

靜態導出

使用 Fumadocs 啟用靜態導出

概覽

Fumadocs 完全兼容 Next.js 靜態導出,允許您將應用程序導出為不需要 Node.js 伺服器的靜態 HTML 站點。

next.config.mjs
/**
 * @type {import('next').NextConfig}
 */
const nextConfig = {
  output: 'export',
};

搜尋

雲解決方案

由於搜尋功能由遠程伺服器提供支持,靜態導出無需配置即可工作。

內置搜尋

Orama 搜尋的預設搜尋配置使用路由處理器,靜態導出不支持這種方式。

相反,您可以按照 Orama 搜尋 指南靜態構建搜尋索引。 並從 Root Provider 在搜尋客戶端上啟用靜態模式:

app/layout.tsx
import { RootProvider } from 'fumadocs-ui/provider';
import type { ReactNode } from 'react';

export default function RootLayout({ children }: { children: ReactNode }) {
  return (
    <html lang="en" suppressHydrationWarning>
      <body>
        <RootProvider
          search={{
            options: {
              type: 'static', 
            },
          }}
        >
          {children}
        </RootProvider>
      </body>
    </html>
  );
}

這允許路由處理器被靜態緩存到單個文件中,搜尋將在瀏覽器中計算。

手動安裝

從零開始創建一個新的 Fumadocs 項目

Markdown

如何撰寫文檔

目錄

概覽
搜尋
雲解決方案
內置搜尋