Skip to content

Commit

Permalink
Merge branch 'main' into update-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandratran authored Nov 17, 2023
2 parents ce6b161 + 75da70a commit 33a5fbc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 11 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const config = {
routeBasePath: "/",
path: "./docs",
includeCurrentVersion: true,
lastVersion: "23.11.0",
lastVersion: "", // defined further down in this file
versions: {}, // defined at ./versions-preset.json
// @ts-ignore
// eslint-disable-next-line global-require
Expand Down Expand Up @@ -440,8 +440,18 @@ const data = fs.readFileSync("./versions-preset.json", {
encoding: "utf8",
flag: "r",
});

let versions = JSON.parse(data);
// Injecting preset versions into config object
config.presets[0][1].docs.versions = versions;
config.presets[0][1].docs.versions.current = {
label: "development",
path: "development",
};

let stableVersion = Object.keys(versions).find((key) =>
versions[key].label.includes("stable"),
);
config.presets[0][1].docs.lastVersion = stableVersion;

module.exports = config;
1 change: 0 additions & 1 deletion versions-preset.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"current": { "label": "development", "path": "development" },
"23.11.0": { "label": "stable (23.11.0)" },
"23.10.0": { "label": "23.10.0" },
"23.9.1": { "label": "23.9.1" },
Expand Down

0 comments on commit 33a5fbc

Please sign in to comment.