入门指南

关于 Geistdocs 的全面入门指南

本指南将引导您完成设置和自定义文档站点所需的所有内容。

先决条件

开始之前,请确保您具备:

  • Node.js 18+ 已在您的系统上安装
  • pnpm(推荐)或您喜欢的 npm 包管理器
  • GitHub 账户 用于仓库托管
  • MDXNext.jsReact 有基本了解

安装

1. 创建新项目

使用 Geistdocs CLI 创建新项目:

Terminal
npx @vercel/geistdocs init

这将把 Geistdocs 的 template 应用克隆到一个新目录。它会提示您输入项目名称,然后安装所有依赖并删除 Geistdocs 网站内容。

2. 配置环境变量

复制示例环境文件:

Terminal
cp .env.example .env.local

然后编辑 .env.local 文件中的环境变量。您可以在 环境变量 部分了解有关环境变量的更多信息。

3. 启动开发服务器

运行开发服务器:

Terminal
pnpm dev

在浏览器中打开 http://localhost:3000 来查看您的文档站点。

4. 创建新页面

content/docs/ 中创建一个新文件:

content/docs/my-first-page.mdx
---
title: 我的第一页
description: 这是我的第一个文档页面
---

# My First Page

Welcome to my documentation! This page will be available at `/docs/my-first-page`.

## Features

- Easy to write with Markdown
- Full React component support
- Automatic navigation generation

## Code Example

```typescript
const greeting = (name: string): string => {
  return `Hello, ${name}!`;
};

console.log(greeting("World"));
```

语法 部分了解有关可用语法的更多信息。