diff --git a/common/community/contribute-to-wiki/how_tos/versioning.md b/common/community/contribute-to-wiki/how_tos/versioning.md new file mode 100644 index 00000000000..eaeadc240eb --- /dev/null +++ b/common/community/contribute-to-wiki/how_tos/versioning.md @@ -0,0 +1,46 @@ +--- +keywords: + - how to +description: How to create and maintain your versioned docs. +--- + +# Versioning + +The Wiki allows you to create your docs. This How-To will explain how it works, how to add a new version, and how to maintain versions. + +## Add Version + +To add a new version, create a new folder inside `docs` in your project folder with the version as its name. For Example, `docs/build/identity.rs/2.0`. This folder should contain a new `docs` folder and a new `sidebars.js` file. + +:::tip + +You can copy an old version or copy from another project and edit everything to your needs. + +::: + +After that, open the `versionedConfig.js` file, look for your project config, and add a new version in the following format: +```js +{ + label: '2.0', + badges: ['IOTA', 'Shimmer'], + // Here, you can add any custom Docusaurus plugin-content-docs option like excludes, includes, etc. For a full list of options, visit: https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-docs + // You can also add a banner that will show up on all pages above the title. + //Example: + //bannerPath: path.resolve( + // __dirname, + // 'banners/some_nice_markdown.mdx', + //), +}, +``` + +## Tag Version + +The wiki versioning uses the order of versions and their tags to show which network is compatible and which version is the main version of the corresponding network. So always sort your plugins from new to old and properly tag them. +The main `IOTA` version is the first one, including the `IOTA` tag. +The main `Shimmer` version is the first one, including the `Shimmer` tag. + +## Version URL Paths + +By default, the main `IOTA` version is accessible at `https://wiki.iota.org//` as this is the stable release, but as with all other versions, it is also reachable over its version: `https://wiki.iota.org//` +For convenience, the main version of each version is also always reachable through `https://wiki.iota.org//iota` or `https://wiki.iota.org//shimmer` in case you want to link to the newest version of a corresponding network. + diff --git a/common/community/sidebars.ts b/common/community/sidebars.ts index fd2a35aa1fd..f67ef4088b7 100644 --- a/common/community/sidebars.ts +++ b/common/community/sidebars.ts @@ -45,6 +45,7 @@ module.exports = { 'contribute-to-wiki/how_tos/write_a_good_tutorial', 'contribute-to-wiki/how_tos/documentation_setup', 'contribute-to-wiki/how_tos/how_to_write_how_tos', + 'contribute-to-wiki/how_tos/versioning', 'contribute-to-wiki/how_tos/request_tw', 'contribute-to-wiki/how_tos/add_a_quiz', ], diff --git a/src/utils/pluginConfigGenerators.js b/src/utils/pluginConfigGenerators.js index 56d753f94aa..25e8c942f8d 100644 --- a/src/utils/pluginConfigGenerators.js +++ b/src/utils/pluginConfigGenerators.js @@ -84,6 +84,12 @@ function createVersionRedirects(versionedConfig) { from: '/' + routeBasePath + '/iota', to: '/' + routeBasePath, }); + + // Redirect to main IOTA version + redirects.push({ + from: '/' + routeBasePath + '/iota', + to: '/' + routeBasePath, + }); } if (mainShimmerVersion && mainShimmerVersion !== mainVersion)