Built using Docusaurus 2, a modern static website generator.
yarn # install deps
yarn startThis command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
By default, the start command will only preview documents in English. If you want to preview documents in other languages, such as Chinese, then add --locale after the command:
yarn start --locale zhyarn buildThis command generates static content into the build directory and can be served using any static contents hosting service.
yarn docusaurus docs:version x.x.xThe versions of the all docs split into two parts, one is the latest (in docs/) and the others are versioned (in versioned_docs/). When a version has been released, the current latest docs/ will be copied into versioned_docs/ (by running the command above).
All translated docs won't be copied automatically. You have to handle them manually. For example, release 2.2.0:
-
Copy
i18n/zh/docusaurus-plugin-content-docs/current.jsonto the same folder and rename it toi18n/zh/docusaurus-plugin-content-docs/version-2.2.0.json. -
The replace
Nextandcurrentinversion-2.2.0.json, e.g.:"version.label": { "message": "Next", "description": "The label for version current" }
to:
"version.label": { "message": "2.2.0", "description": "The label for version 2.2.0" }
Don't forget test the new version build after you've done the above steps!
For patch versions, it's only needed to move some folders and change some text. For example, v2.1.3 to v2.1.4:
- Replace
2.1.3in versions.json with2.1.4. versioned_docs/version-2.1.3toversioned_docs/version-2.1.4.versioned_sidebars/version-2.1.3-sidebars.jsontoversioned_sidebars/version-2.1.4-sidebars.jsonand replace2.1.3with2.1.4(if have) in json.i18n/zh/docusaurus-plugin-content-docs/version-2.1.3toi18n/zh/docusaurus-plugin-content-docs/version-2.1.4.i18n/zh/docusaurus-plugin-content-docs/version-2.1.3.jsontoi18n/zh/docusaurus-plugin-content-docs/version-2.1.4.jsonand replace2.1.3with2.1.4in json.- Update
src/data/versions.js.
Don't forget test the new version build after you've done the above steps!
Mostly you only need to modify the content in the docs/, but if you want some versions to take effect as the latest, please also update the same files in the versioned_docs/ dir.
Same as Chaos Mesh.