ShipNow LogoShipNow

文档

ShipNow 提供了一个功能强大的文档系统,内置 Fumadocs 支持 MDX、搜索和国际化。

概述

ShipNow 的文档功能使您能够:

  • 📄 使用 Markdown 和 MDX 创建和管理文档
  • 🌐 支持多种语言和翻译
  • 🗂️ 自动生成导航结构
  • 🔍 提供全文搜索功能
  • 🎨 自定义样式和主题

为什么使用内置文档?

在您的应用程序中内置文档提供了几个关键优势:

  1. SEO 优化: 将文档放在主域名上比子域名更利于关键词权重积累,提升搜索引擎排名
  2. 用户体验: 用户获得与主站无缝衔接的体验,强化品牌认知
  3. 产品集成: 深度整合产品功能到文档场景,直接提升用户使用效率

创建一个新页面

  1. 在 docs 目录中创建一个 MDX 文件:

    touch content/docs/getting-started.mdx
  2. 添加前端元数据:

    getting-started.mdx
    ---
    title: 入门
    description: 学习如何开始使用我们的平台
    ---
  3. 使用 Markdown 和 MDX 编写您的内容:

    getting-started.mdx
    ## 快速入门
     
    1. 安装包
    2. 配置设置
    3. 开始使用功能
     
    <Callout>
      请先检查要求!
    </Callout>

文件结构

文档按目录组织:

content/docs/
├── index.mdx          # 首页
├── features/          # 功能文档
│   ├── documentation.mdx
│   └── deployment.mdx
└── api/               # API 文档
    └── reference.mdx

图标

您可以在前端元数据中指定图标名称来使用任何 Tabler 图标

---
title: API 参考
icon: Code  # 使用 Tabler 的 Code 图标
---

Markdown 特性

图片

您可以在文档中添加图片:

![Alt Text](image.png)

代码块

您可以创建语法高亮的代码块:

function hello(name: string) {
  console.log(`Hello ${name}!`);
}

高亮

使用高亮来突出重要信息:

> **Note**: This is an important note

列表

  • 项目符号
  • 支持
  • 像这样
  1. 编号列表
  2. 也支持
  3. 像这样

查看 Fumadocs Markdown 了解更多特性。

国际化

您可以通过在文件名中添加 .{locale} 来为特定语言创建 Markdown 文件,例如 page.zh-TW.mdx

示例:

content/docs/
├── index.mdx       # 英语版本
├── index.zh-TW.mdx # 繁体中文版本
  1. 添加语言到 config/locales.ts:

    config/locales.ts
    export const locales = [
      { code: 'en', name: 'English' },
      { code: 'zh-CN', name: '简体中文' },
      { code: 'zh-TW', name: '繁體中文' }, // 添加此行
    ] as const;
  2. 复制内容到新文件:

    cp content/docs/index.mdx content/docs/index.zh-TW.mdx
  3. 使用以下 Prompt 请 AI 翻译内容:

    Translate the following content to Traditional Chinese:
    
    // The content to translate
    

搜索

文档包含一个强大的搜索功能。按 ⌘K (Mac) 或 Ctrl+K (Windows) 聚焦搜索。

需要帮助吗?

如果您需要文档系统的帮助:

  • 查看 Fumadocs 文档
  • 加入我们的社区 Discord
  • 在 GitHub 上提交问题

On this page

ShipNow Logo获取 ShipNow