配置

在不修改源文件的情况下自定义您的 Geistdocs 站点

虽然 Geistdocs 完全开源、可组合且可复制粘贴,但最好在不修改源代码的情况下自定义您的站点。这样可以在保留自定义内容的同时,更容易在未来更新 Geistdocs。

为此,Geistdocs 使用一个根级配置文件,让您可以在不接触源代码的情况下自定义文档站点。

配置文件

项目根目录下的 geistdocs.tsx 文件包含所有自定义选项:

geistdocs.tsx
import { BookHeartIcon } from "lucide-react";

export const Logo = () => (
  <div className="flex items-center gap-2">
    <BookHeartIcon className="size-5" />
    <p className="font-semibold text-xl tracking-tight">Geistdocs</p>
  </div>
);

export const nav = [
  {
    label: "Docs",
    href: "/docs",
  },
];

export const suggestions = [
  "What is Vercel?",
  "What can I deploy with Vercel?",
  "What is Fluid Compute?",
  "How much does Vercel cost?",
];

export const title = "Geistdocs Documentation";

export const prompt =
  "You are a helpful assistant specializing in answering questions about Geistdocs, a modern documentation template built with Next.js and Fumadocs.";

配置选项

自定义显示在站点页眉中的徽标组件:

geistdocs.tsx
export const Logo = () => (
  <div className="flex items-center gap-2">
    <YourIcon className="size-5" />
    <p className="font-semibold text-xl tracking-tight">Your Brand</p>
  </div>
);

定义显示在页眉中的导航链接:

geistdocs.tsx
export const nav = [
  {
    label: "Documentation",
    href: "/docs",
  },
  {
    label: "API Reference",
    href: "/api",
  },
  {
    label: "GitHub",
    href: "https://github.com/your-org/your-repo",
  },
];

suggestions

为 AI 助手配置建议的问题:

geistdocs.tsx
export const suggestions = [
  "How do I get started?",
  "What are the key features?",
  "How do I deploy my site?",
  "Where can I get help?",
];

title

设置文档站点的主标题:

geistdocs.tsx
export const title = "Your Product Documentation";

prompt

自定义 AI 助手的系统提示,以匹配您的文档上下文:

geistdocs.tsx
export const prompt =
  "You are a helpful assistant specializing in answering questions about Your Product, a platform for building amazing applications.";

On this page

GitHubEdit this page on GitHub