Skip to content

Commit 7cf6746

Browse files
committed
reversion docs
Signed-off-by: chenqiming <[email protected]>
1 parent 61fc7ac commit 7cf6746

File tree

73 files changed

+24
-7
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+24
-7
lines changed

docusaurus.config.js

+18-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@
55
// See: https://docusaurus.io/docs/api/docusaurus-config
66

77
import {themes as prismThemes} from 'prism-react-renderer';
8+
const versions = require('./versions.json');
9+
10+
function getNextVersionName() {
11+
const expectedPrefix = 'v';
12+
13+
const lastReleasedVersion = versions[0];
14+
if (!lastReleasedVersion.includes(expectedPrefix)) {
15+
throw new Error(
16+
'version must be started with v.',
17+
);
18+
}
19+
const version = parseFloat(lastReleasedVersion.replace(expectedPrefix, ''));
20+
const nextVersion = (version + 0.1).toFixed(1)
21+
return `${expectedPrefix}${nextVersion}`;
22+
}
23+
24+
825

926
/** @type {import('@docusaurus/types').Config} */
1027
const config = {
@@ -62,7 +79,7 @@ const config = {
6279
routeBasePath: 'docs',
6380
versions: {
6481
current: {
65-
label: `Latest 🚧`
82+
label: `${getNextVersionName()} 🚧`
6683
},
6784
},
6885
},

i18n/zh/docusaurus-plugin-content-docs/current.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"version.label": {
3-
"message": "Latest",
3+
"message": "v0.10",
44
"description": "The label for version current"
55
},
66
"sidebar.tutorialSidebar.category.Getting Started": {

versioned_docs/version-v1.0.0/get-started/installation.md renamed to versioned_docs/version-v0.9/get-started/installation.md

+4-4

versions.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[
2-
"v1.0.0"
2+
"v0.9"
33
]

0 commit comments

Comments
 (0)