Skip to content

Commit

Permalink
KAD-DOC-54: enable versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Bruder committed Feb 23, 2025
1 parent b59e027 commit afe8af3
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 4 deletions.
59 changes: 58 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,64 @@ This command generates static content into the `build` directory and can be serv
```
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

# 📨Contact
## 📚Versioning
We align versioning of our documentation with the release of major versions in terms of [Semantic Versioning](https://semver.org/).

Therefore, we keep patching the _current_ (major) version until the _next_ (major) version is released.
The [`/docs`](./docs) folder represents the _current_ version while older, unmaintained versions reside in [`/versioned_docs`](./versioned_docs).

Let's consider publishing the _next_ version `A.B.C` and assume our _current_ version is `X.Y.Z`.
We want to publish `A.B.C`. Therefore:
1. open a command-line in the project's root and run
```bash
npm run docusaurus docs:version X.Y.Z
```
2. set the label of the new _current_ version `A.B.C` in [`/docusaurus.config.js`](./docusaurus.config.js) at `config.presets.docs.versions.current.label` to `vA.B.C`,
```json
...
versions: {
current: {
label: 'vA.B.C',
path: '/',
badge: true,
},
...
}
...
```
3. add the new _previous_ version `X.Y.Z` there:
```json
...
versions: {
current: {
label: 'vA.B.C',
path: '/',
badge: true,
},
"X.Y.Z": {
label: 'vX.Y.Z',
path: 'X.Y.Z',
badge: true,
},
...
}
...
```
4. move the version `"current"` in [`./versions.json`](./versions.json) above `"X.Y.Z"`, it should now look like:
```json
[
"current",
"X.Y.Z",
...
]
```

You did it! The _current_ version is now `A.B.C` and the _previous_ version is now `X.Y.Z`.
Now we maintain the _current_ version simply by editing in the [`/docs`](./docs) folder.

If we need to edit an older version, e.g. the _previous_ version, we can edit in `/versioned_docs/version-X.Y.Z`.

## 📨Contact

If you have any questions or ideas feel free to create an [issue](https://github.com/kadai-io/kadai/issues) or contact us
via [GitHub Discussions](https://github.com/kadai-io/kadai/discussions).
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/getting-started/exampleSpringBoot.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ In the first 4 steps, we will set up KADAI REST API without security. Then, we w
the resulting REST API with [Postman](https://www.postman.com/). This guide then sets up security.
At the end of the guide, we will add the UI.

import styles from '../../../src/components/HomepageFeatures/styles.module.css';
import styles from '@site/src/components/HomepageFeatures/styles.module.css';
import Link from '@docusaurus/Link';

## What you'll need
Expand Down
16 changes: 15 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ const config = {
({
docs: {
sidebarPath: require.resolve('./sidebars.js'),
includeCurrentVersion: false,
lastVersion: 'current',
versions: {
current: {
label: 'v9.2.*',
path: '/',
badge: true,
},
},
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
Expand Down Expand Up @@ -95,7 +104,12 @@ const config = {
docId: 'demo-app/demoApp',
label: 'Demo App',
position: 'right',
}
},
{
type: 'docsVersionDropdown',
position: 'right',
dropdownActiveClassDisabled: true,
},
],
},
footer: {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@
},
"engines": {
"node": ">=16.14"
}
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
3 changes: 3 additions & 0 deletions versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"current"
]

0 comments on commit afe8af3

Please sign in to comment.