简体   繁体   中英

How to support changes in older versions of docs maintained by docusaurus

I'm trying out Docusaurus tool for creating a documentation site. So far everything is okay until I came to Versioning .

My understanding is that:

  1. Whatever is in your /docs/**/*.md is your latest docs for next release
  2. Previous versions of your docs are available in /website/versioned-docs/version-${version-number} directory

What is not clear to me is that how do I maintain/publish changes to previous versions? My changes in /docs/** directory is not ready for publishing yet. So, what is the mechanism for maintaining changes to older version of docs?

Also, the documentation of Docusaurus says following:

Fallback Functionality

Only files in the docs directory and sidebar files that differ from those of the latest version will get copied each time a new version is specified. If there is no change across versions, Docusaurus will use the file from the latest version with that file.

For example, a document with the original id doc1 exists for the latest version, 1.0.0, and has the same content as the document with the id doc1 in the docs directory. When a new version 2.0.0 is created, the file for doc1 will not be copied into versioned_docs/version-2.0.0/. There will still be a page for docs/2.0.0/doc1.html, but it will use the file from version 1.0.0.

https://docusaurus.io/docs/en/versioning#fallback-functionality

So, let's say I now need to maintain/update a doc of a previous version but that file was not duplicated because at the time the new version was created, there wasn't any changes to this particular file. Now, what is the process? Do I manually copy the necessary file into /website/versioned-docs/version-${version-number} directory and then make my changes?

Docusaurus maintainer here. Due to the way versioning is implemented, there's no easy way of updating previous versions in V1. You might not want to update previous versions as a version should be frozen when published and updates should be made to new versions.

But if you insist, you can always edit the generated files under the versioned_docs/version-XXX directories. However, I would recommend making changes to the latest version and encouraging your users to upgrade to the latest version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM