Skip to content

Commit

Permalink
Created versions-preset.json (#499)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucassaldanha authored Nov 14, 2023
1 parent 16e190d commit 5b72965
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
28 changes: 10 additions & 18 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const fs = require("fs");
const lightCodeTheme = require("prism-react-renderer/themes/github");
const darkCodeTheme = require("prism-react-renderer/themes/dracula");

Expand Down Expand Up @@ -40,24 +41,7 @@ const config = {
path: "./docs",
includeCurrentVersion: true,
lastVersion: "23.10.0",
versions: {
//defaults to the ./docs folder
// using 'development' instead of 'next' as path
current: {
label: "development",
path: "development",
},
//the last stable release in the versioned_docs/version-stable
"23.10.0": {
label: "stable (23.10.0)",
},
"23.9.1": {
label: "23.9.1",
},
"23.8.0": {
label: "23.8.0",
},
},
versions: {}, // defined at ./versions-preset.json
// @ts-ignore
// eslint-disable-next-line global-require
remarkPlugins: [require("remark-docusaurus-tabs")],
Expand Down Expand Up @@ -452,4 +436,12 @@ const config = {
],
};

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;

module.exports = config;
6 changes: 6 additions & 0 deletions versions-preset.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"current": { "label": "development", "path": "development" },
"23.10.0": { "label": "stable (23.10.0)" },
"23.9.1": { "label": "stable (23.9.1)" },
"23.8.0": { "label": "23.8.0" }
}

1 comment on commit 5b72965

@vercel
Copy link

@vercel vercel bot commented on 5b72965 Nov 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

doc-teku – ./

docs.teku.consensys.net
doc-teku-infura-web.vercel.app
doc-teku-git-main-infura-web.vercel.app

Please sign in to comment.