# Fumadocs (Framework Mode, Next.js): 靜態建置
URL: /zh-TW/docs/next/deploying/static
Source: https://raw.githubusercontent.com/fuma-nama/fumadocs/refs/heads/main/apps/docs/content/docs/(framework)/[framework]/deploying/static.zh-TW.mdx

使用 Fumadocs 輸出靜態網站。

## 設定 [#setup]

Fumadocs 預設採用伺服器優先的做法，因此需要有執行中的伺服器。
您可以透過設定 Next.js 來輸出靜態建置。

靜態建置沒有伺服器，因此下列功能無法運作：

* 搜尋伺服器。請改用[靜態搜尋](#search)。
* [詢問 AI](/docs/next/integrations/llms#ask-ai)，因為其聊天路由需要呼叫 AI 模型。
* [MCP 伺服器](/docs/next/integrations/llms#mcp-server)。

`proxy.ts` 也不會執行，因此不會有導向至語系的 [i18n 重新導向](/docs/next/internationalization#middleware)，頁面也無法[依 `Accept` 標頭提供 Markdown](/docs/next/integrations/llms#accept)。

### 搜尋 [step] [#search]

#### 內建搜尋 [#built-in-search]

1. [設定搜尋伺服器](/docs/headless/search/orama#static-export)。
2. [設定搜尋 UI／用戶端](/docs/next/search/orama#static)。

完成設定後，您的應用程式會以靜態方式儲存搜尋索引，並改在瀏覽器端執行搜尋運算。

#### 雲端解決方案 [#cloud-solutions]

由於搜尋功能由遠端伺服器提供，靜態匯出無需額外設定即可運作。

### 部署 [step] [#deployment]

啟用靜態匯出，即可輸出不需 Node.js 伺服器也能執行的靜態 HTML 網站：

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

  // 選用：將連結 `/me` 改為 `/me/`，並將輸出的 `/me.html` 改為 `/me/index.html`
  // trailingSlash: true,

  // 選用：避免自動將 `/me` 導向 `/me/`，改為保留原本的 `href`
  // skipTrailingSlashRedirect: true,
};
```

限制與詳細資訊請參閱 [Next.js 文件](https://nextjs.org/docs/app/guides/static-exports)。