我正在尝试创建文档站点的 Docusaurus 工具。到目前为止,一切都还好,直到我来到版本控制。
我的理解是:
- 您的内容是您下一个版本
/docs/**/*.md
的最新文档 - 您的文档的早期版本在
/website/versioned-docs/version-${version-number}
目录中可用
我不清楚的是如何维护/发布对以前版本的更改?我的/docs/**
目录更改尚未准备好发布。那么,维护旧版本文档更改的机制是什么?
此外,Docusaurus 的文档说明如下:
后备功能
每次指定新版本时,只会复制 docs 目录和侧边栏文件中与最新版本不同的文件。如果版本之间没有变化,Docusaurus 将使用最新版本的文件和该文件。
例如,最新版本 1.0.0 存在原始 id 为 doc1 的文档,并且与 docs 目录中的 id 为 doc1 的文档内容相同。创建新版本 2.0.0 时,不会将 doc1 的文件复制到 versioned_docs/version-2.0.0/。docs/2.0.0/doc1.html 仍然会有一个页面,但它将使用版本 1.0.0 中的文件。
https://docusaurus.io/docs/en/versioning#fallback-functionality
因此,假设我现在需要维护/更新以前版本的文档,但该文件没有重复,因为在创建新版本时,该特定文件没有任何更改。现在,流程是什么?我是否手动将必要的文件复制到/website/versioned-docs/version-${version-number}
目录中,然后进行更改?