Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Versioning doc #1245

Merged
merged 6 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions common/community/contribute-to-wiki/how_tos/versioning.md
Original file line number Diff line number Diff line change
@@ -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.
Dr-Electron marked this conversation as resolved.
Show resolved Hide resolved

## Add Version
Dr-Electron marked this conversation as resolved.
Show resolved Hide resolved

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'],
Dr-Electron marked this conversation as resolved.
Show resolved Hide resolved
// 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
Dr-Electron marked this conversation as resolved.
Show resolved Hide resolved

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/<your-project>/` as this is the stable release, but as with all other versions, it is also reachable over its version: `https://wiki.iota.org/<your-project>/<main-iota-version>`
For convenience, the main version of each version is also always reachable through `https://wiki.iota.org/<your-project>/iota` or `https://wiki.iota.org/<your-project>/shimmer` in case you want to link to the newest version of a corresponding network.

1 change: 1 addition & 0 deletions common/community/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
],
Expand Down
6 changes: 6 additions & 0 deletions src/utils/pluginConfigGenerators.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down