Skip to content

🎥 Make videos programmatically with React

easier docs creation

Jonny Burger4cc58a92fa8c
diff --git a/packages/docs/docusaurus.config.js b/packages/docs/docusaurus.config.js
index a5c0a0a6d5..1c43c29f4f 100644
--- a/packages/docs/docusaurus.config.js
+++ b/packages/docs/docusaurus.config.js
@@ -1,4 +1,9 @@
-module.exports = {
+/**
+ *
+ * @param {"complete" | "new-doc"} mode
+ * @returns
+ */
+const config = (mode) => ({
title: "Remotion | Make videos programmatically in React",
tagline: "Make videos programmatically",
url:
@@ -50,13 +55,15 @@ module.exports = {
type: "docSidebar",
sidebarId: "mainSidebar",
},
- {
- to: "/docs/api",
- label: "API",
- position: "left",
- type: "docSidebar",
- sidebarId: "apiSidebar",
- },
+ mode === "complete"
+ ? {
+ to: "/docs/api",
+ label: "API",
+ position: "left",
+ type: "docSidebar",
+ sidebarId: "apiSidebar",
+ }
+ : null,
{ to: "/docs/license", label: "Pricing", position: "left" },
{
type: "dropdown",
@@ -97,7 +104,7 @@ module.exports = {
"data-splitbee-event": "External Link",
"data-splitbee-event-target": "GitHub",
},
- ],
+ ].filter(Boolean),
},
footer: {
style: "light",
@@ -225,7 +232,11 @@ module.exports = {
"@docusaurus/preset-classic",
{
docs: {
- sidebarPath: require.resolve("./sidebars.js"),
+ path: mode === "complete" ? "docs" : "new-docs",
+ sidebarPath:
+ mode === "complete"
+ ? require.resolve("./sidebars.js")
+ : require.resolve("./fast-sidebars.js"),
editUrl:
"https://github.com/remotion-dev/remotion/edit/main/packages/docs/",
},
@@ -292,4 +303,7 @@ module.exports = {
],
"./route-plugin",
],
-};
+});
+
+module.exports = config("complete");
+module.exports.config = config;
diff --git a/packages/docs/fast-sidebars.js b/packages/docs/fast-sidebars.js
new file mode 100644
index 0000000000..e357dfe8d4
--- /dev/null
+++ b/packages/docs/fast-sidebars.js
@@ -0,0 +1 @@
+module.exports = { mainSidebar: ["new-article"] };
diff --git a/packages/docs/new-docs/new-article.md b/packages/docs/new-docs/new-article.md
new file mode 100644
index 0000000000..3f88daf19f
--- /dev/null
+++ b/packages/docs/new-docs/new-article.md
@@ -0,0 +1,3 @@
+---
+id: new-article
+---
diff --git a/packages/docs/simple-docusaurus.config.js b/packages/docs/simple-docusaurus.config.js
new file mode 100644
index 0000000000..3adda3b4a0
--- /dev/null
+++ b/packages/docs/simple-docusaurus.config.js
@@ -0,0 +1,5 @@
+const { config } = require("./docusaurus.config.js");
+
+module.exports = {
+ ...config("new-doc"),
+};