Versioning
Versioning with Makersaurus is almost identical to versioning with Docusaurus. There are two steps involved: adding configuration properties to makersaurus.config.js
and creating versioned copies of the docs.
Config properties
The following versioning properties are available in makersaurus.config.js
:
Property | Type | Default value |
---|---|---|
includeCurrentVersions | boolean | true |
disableVersioning | boolean | false |
lastVersion | string | current |
versions | object |
Only the versions
object is required to enable versioning - the remaining properties only need to be set if you want to deviate from the default values.
Refer to the Docusaurus verisoning docs for descriptions of what these properties do. There is only one difference in Makersaurus: if the versions
object is present in makersaurus.config.js
, the version dropdown will automatically be added to the header.
Versioned files
Versioned projects require three things in the root of your project:
versions.json
fileversioned_sidebars
folderversioned_docs
folder
Refer to the Docusaurus verisoning docs for a detailed explanation of what these files should look like. Makersaurus handles the job of syncing these files and folders if they are present so that versioning works the same as normal.
In the versioned_sidebars
folder Docusaurus does not recognize JS config files, only JSON. Make sure to use JSON if you want the sidebar to show up properly. You can paste the contents of sidebars.js
into an online conversion tool to do the work for you.
Docusaurus includes a convenience command for freezing a version of the docs:
npm run docusaurus docs:version x.y.z
For technical reasons Makersaurus does not have a command like this, you will have to create the aforementioned files manually. All that is required is copying the sidebars.js
file and the contents of the docs
folder into the versioned_
folders, then creating or modifying versions.json
to include the new version.
Development
The development server will pick up any changes you make to the versioned_docs
folder automatically. For changes to versioned_sidebars
or versions.json
you will have to stop the process and run npm start
again.
- Submit and view feedback for this page
- Send feedback about Makersaurus Docs to cloud-feedback@h2o.ai