Fumadocs

版本控制

在你的文档中实现多版本管理。

概览

🌐 Overview

开发者工具相关的文档通常会对文档进行版本管理,例如同一个工具的 v1 和 v2 会有不同的文档。

🌐 It's common for developer tool related docs to version their docs, such as different docs for v1 and v2 of the same tool.

Fumadocs 为你提供了实现自定义版本控制的基础功能。

🌐 Fumadocs provide the primitives for you to implement versioning on your own way.

部分版本控制

🌐 Partial Versioning

当版本控制只适用于文档的一部分时,你可以通过文件夹将它们分开。

🌐 When versioning only applies to part of your docs, You can separate them by folders.

例如:

🌐 For example:

getting-started.mdx
getting-started.mdx

值得了解

在使用文件夹进行分组时,你可以将它们显示为标签页 使用侧边栏标签

完整版本

🌐 Full Versioning

有时你可能希望对整个网站进行版本控制,例如 https://v14.fumadocs.dev(Fumadocs v14)和 https://fumadocs.dev(最新的 Fumadocs)。

🌐 Sometimes you want to version the entire website, such as https://v14.fumadocs.dev (Fumadocs v14) and https://fumadocs.dev (Latest Fumadocs).

你可以为文档的某个版本创建一个 Git 分支(例如命名为 v2),并将其作为一个独立的应用部署到另一个子域名上,比如 v2.my-site.com

🌐 You can create a Git branch for a version of docs (call it v2 for example), and deploy it as a separate app on another subdomain like v2.my-site.com.

可选地,你可以在文档中链接到其他版本。
这种设计相对于部分版本控制具有一些优势:

🌐 Optionally, you can link to the other versions from your docs. This design allows some advantages over partial versioning:

  • 易于维护:在迭代或升级依赖时,旧的文档/分支不会受到影响。
  • 更好的一致性:不仅是文档本身,你的登录页(以及其他页面)也将进行版本管理。

Last updated on

On this page