diff --git a/_redirects b/_redirects new file mode 100644 index 00000000..2a2f0697 --- /dev/null +++ b/_redirects @@ -0,0 +1,5 @@ +/docs/category/Releases/* /docs/releases/:splat 301 +/docs/category/Releases /docs/releases 301 + +/docs/category/concepts /docs/Concepts/clusters-environments 301 +/docs/category/howto /docs/HowTo/analytics 301 \ No newline at end of file diff --git a/current-routes.json b/current-routes.json new file mode 100644 index 00000000..d609a8ce --- /dev/null +++ b/current-routes.json @@ -0,0 +1,141 @@ +[ + "/404.html", + "/__docusaurus/debug", + "/__docusaurus/debug/config", + "/__docusaurus/debug/content", + "/__docusaurus/debug/globalData", + "/__docusaurus/debug/metadata", + "/__docusaurus/debug/registry", + "/__docusaurus/debug/routes", + "/blog", + "/blog/archive", + "/blog/Effortless-Kafka-Governance-making-Life-Easier-for-Developers", + "/blog/high-availability-for-klaw", + "/blog/important-community-update-klaws-latest-actions-to-enhance-transparency", + "/blog/schema-management-disaster-recovery-in-klaw", + "/blog/tags", + "/blog/tags/2-5-2", + "/blog/tags/2-6-1", + "/blog/tags/acls", + "/blog/tags/active", + "/blog/tags/disaster-recovery", + "/blog/tags/evolution", + "/blog/tags/fault-tolerance", + "/blog/tags/governance", + "/blog/tags/high-availability", + "/blog/tags/kafka", + "/blog/tags/klaw", + "/blog/tags/migration", + "/blog/tags/passive", + "/blog/tags/schema-registry", + "/blog/tags/topics", + "/blog/tags/transparency", + "/docs/", + "/docs/Concepts/clusters-environments", + "/docs/Concepts/config", + "/docs/Concepts/high-availability", + "/docs/Concepts/metastore", + "/docs/Concepts/promotion", + "/docs/Concepts/switch-teams", + "/docs/Concepts/synchronize", + "/docs/Concepts/users-teams", + "/docs/Concepts/workflows", + "/docs/faq", + "/docs/features", + "/docs/getstarted", + "/docs/HowTo/analytics", + "/docs/HowTo/authentication/", + "/docs/HowTo/authentication/azure-ad", + "/docs/HowTo/authentication/google-account", + "/docs/HowTo/authentication/third-party-account", + "/docs/HowTo/authentication/userpwd-db", + "/docs/HowTo/authentication/windows-ad", + "/docs/HowTo/authorization", + "/docs/HowTo/clusterconnectivity/", + "/docs/HowTo/clusterconnectivity/aiven-kafka-cluster-sasl-ssl-protocol", + "/docs/HowTo/clusterconnectivity/aiven-kafka-cluster-ssl-protocol", + "/docs/HowTo/clusterconnectivity/aiven-kafka-connect-cluster-ssl-protocol", + "/docs/HowTo/clusterconnectivity/aiven-karapace-cluster-ssl-protocol", + "/docs/HowTo/clusterconnectivity/confluent-cloud-kafka-cluster-ssl-protocol", + "/docs/HowTo/clusterconnectivity/kafka-cluster-sasl-ssl-protocol", + "/docs/HowTo/clusterconnectivity/kafka-cluster-ssl-protocol", + "/docs/HowTo/clusterconnectivity/klaw-core-with-clusterapi", + "/docs/HowTo/clusterconnectivity/klaw-db-connection", + "/docs/HowTo/clusterconnectivity/sr-cluster-ssl-protocol", + "/docs/HowTo/clusters", + "/docs/HowTo/connectors/", + "/docs/HowTo/connectors/Approve-a-connector", + "/docs/HowTo/connectors/manage-connectors", + "/docs/HowTo/connectors/My-connector-requests", + "/docs/HowTo/connectors/Request-a-new-connector", + "/docs/HowTo/dashboard", + "/docs/HowTo/deployklaw", + "/docs/HowTo/environments", + "/docs/HowTo/exportimport/", + "/docs/HowTo/exportimport/exportdata", + "/docs/HowTo/exportimport/importdata", + "/docs/HowTo/installation/", + "/docs/HowTo/installation/configure-klaw-wizard", + "/docs/HowTo/installation/run-docker", + "/docs/HowTo/installation/run-source", + "/docs/HowTo/kafka-cluster-migration/", + "/docs/HowTo/kafka-cluster-migration/sync-acls-from-cluster", + "/docs/HowTo/kafka-cluster-migration/sync-acls-to-cluster", + "/docs/HowTo/kafka-cluster-migration/sync-connectors-from-cluster", + "/docs/HowTo/kafka-cluster-migration/sync-schemas-from-cluster", + "/docs/HowTo/kafka-cluster-migration/sync-schemas-to-cluster", + "/docs/HowTo/kafka-cluster-migration/sync-topics-from-cluster", + "/docs/HowTo/kafka-cluster-migration/sync-topics-to-cluster", + "/docs/HowTo/kafka-cluster-migration/tenant-config", + "/docs/HowTo/notifications/", + "/docs/HowTo/notifications/email-notification", + "/docs/HowTo/notifications/slack-notification", + "/docs/HowTo/operational/", + "/docs/HowTo/operational/Reset-Consumer-Offsets", + "/docs/HowTo/rolespermissions", + "/docs/HowTo/schemas/", + "/docs/HowTo/schemas/manage-schemas", + "/docs/HowTo/schemas/My-schema-requests", + "/docs/HowTo/schemas/Promote-a-schema", + "/docs/HowTo/schemas/Request-a-schema", + "/docs/HowTo/settings", + "/docs/HowTo/subscriptions/", + "/docs/HowTo/subscriptions/Approve-a-subscription", + "/docs/HowTo/subscriptions/Delete-a-subscription", + "/docs/HowTo/subscriptions/My-subscription-requests", + "/docs/HowTo/subscriptions/Request-a-subscription", + "/docs/HowTo/teams/", + "/docs/HowTo/teams/manage-teams", + "/docs/HowTo/teams/switch-teams", + "/docs/HowTo/tenant", + "/docs/HowTo/topics/", + "/docs/HowTo/topics/Approve-a-topic", + "/docs/HowTo/topics/Claim-a-topic", + "/docs/HowTo/topics/Delete-a-topic", + "/docs/HowTo/topics/Edit-topic-request", + "/docs/HowTo/topics/My-topic-requests", + "/docs/HowTo/topics/Promote-a-topic", + "/docs/HowTo/topics/Request-a-new-topic", + "/docs/HowTo/topics/Topic-overview", + "/docs/HowTo/topics/View-consumer-lag", + "/docs/HowTo/topics/View-topic-events", + "/docs/HowTo/users", + "/docs/HowTo/zothers", + "/docs/quickstart", + "/docs/releases", + "/docs/releases/release100", + "/docs/releases/release110", + "/docs/releases/release120", + "/docs/releases/release200", + "/docs/releases/release210", + "/docs/releases/release220", + "/docs/releases/release230", + "/docs/releases/release240", + "/docs/releases/release250", + "/docs/releases/release251", + "/docs/releases/release252", + "/docs/releases/release260", + "/docs/releases/release261", + "/docs/releases/release270", + "/" +] diff --git a/docs/HowTo/deployklaw.md b/docs/HowTo/deployklaw.md index b249d52d..10d2e7c7 100644 --- a/docs/HowTo/deployklaw.md +++ b/docs/HowTo/deployklaw.md @@ -4,7 +4,9 @@ Learn how to deploy Klaw with an outline of steps and key points for a smooth up ## Klaw releases cycle -Our team, along with Klaw's contributors, is committed to enhancing the functionality and efficiency of Klaw, aiming to deliver new updates approximately every 1.5 months. You can access all past and the most recent releases [here](../../docs/category/Releases). Highlighted updates include versions such as 2.4.0, 2.5.0, among others. +Our team, along with Klaw's contributors, is committed to enhancing the functionality and efficiency of Klaw, aiming +to deliver new updates approximately every 1.5 months. You can access all past and the most recent releases [here](.. +/../docs/releases). Highlighted updates include versions such as 2.4.0, 2.5.0, among others. ## Deployment strategy diff --git a/docs/Releases/_category_.json b/docs/releases/_category_.json similarity index 81% rename from docs/Releases/_category_.json rename to docs/releases/_category_.json index 0f6e474a..b3ea33fd 100644 --- a/docs/Releases/_category_.json +++ b/docs/releases/_category_.json @@ -1,6 +1,6 @@ { "label": "Releases", - "position": 5, + "position": 1, "link": { "type": "generated-index" } diff --git a/docs/Releases/release100.md b/docs/releases/release100.md similarity index 100% rename from docs/Releases/release100.md rename to docs/releases/release100.md diff --git a/docs/Releases/release110.md b/docs/releases/release110.md similarity index 100% rename from docs/Releases/release110.md rename to docs/releases/release110.md diff --git a/docs/Releases/release120.md b/docs/releases/release120.md similarity index 100% rename from docs/Releases/release120.md rename to docs/releases/release120.md diff --git a/docs/Releases/release200.md b/docs/releases/release200.md similarity index 100% rename from docs/Releases/release200.md rename to docs/releases/release200.md diff --git a/docs/Releases/release210.md b/docs/releases/release210.md similarity index 100% rename from docs/Releases/release210.md rename to docs/releases/release210.md diff --git a/docs/Releases/release220.md b/docs/releases/release220.md similarity index 100% rename from docs/Releases/release220.md rename to docs/releases/release220.md diff --git a/docs/Releases/release230.md b/docs/releases/release230.md similarity index 100% rename from docs/Releases/release230.md rename to docs/releases/release230.md diff --git a/docs/Releases/release240.md b/docs/releases/release240.md similarity index 100% rename from docs/Releases/release240.md rename to docs/releases/release240.md diff --git a/docs/Releases/release250.md b/docs/releases/release250.md similarity index 100% rename from docs/Releases/release250.md rename to docs/releases/release250.md diff --git a/docs/Releases/release251.md b/docs/releases/release251.md similarity index 100% rename from docs/Releases/release251.md rename to docs/releases/release251.md diff --git a/docs/Releases/release252.md b/docs/releases/release252.md similarity index 100% rename from docs/Releases/release252.md rename to docs/releases/release252.md diff --git a/docs/Releases/release260.md b/docs/releases/release260.md similarity index 100% rename from docs/Releases/release260.md rename to docs/releases/release260.md diff --git a/docs/Releases/release261.md b/docs/releases/release261.md similarity index 100% rename from docs/Releases/release261.md rename to docs/releases/release261.md diff --git a/docs/Releases/release270.md b/docs/releases/release270.md similarity index 100% rename from docs/Releases/release270.md rename to docs/releases/release270.md diff --git a/docusaurus.config.js b/docusaurus.config.js index 562bb958..cd6bf4cb 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -1,5 +1,7 @@ // @ts-check // Note: type annotations allow type checking and IDEs autocompletion +const { addRedirectsFile } = require("./plugins/add-redirects-file"); +const { createLinkFile } = require("./plugins/create-link-file"); const lightCodeTheme = require("prism-react-renderer").themes.github; const darkCodeTheme = require("prism-react-renderer").themes.dracula; @@ -49,6 +51,7 @@ const config = { theme: { customCss: require.resolve("./src/css/custom.css"), }, + debug: true, }), ], ], @@ -71,15 +74,16 @@ const config = { items: [ { type: "docSidebar", - sidebarId: "tutorialSidebar", + sidebarId: "docs", position: "left", label: "Docs", }, { to: "/blog", label: "Blog", position: "left" }, { - to: "/docs/category/Releases", - label: "Releases", + type: "docSidebar", + sidebarId: "releases", position: "left", + label: "Releases", }, { href: "https://github.com/aiven/klaw", @@ -138,6 +142,14 @@ const config = { darkTheme: darkCodeTheme, }, }), + plugins: [ + () => ({ + postBuild(props) { + createLinkFile(props); + addRedirectsFile(props); + }, + }), + ], }; module.exports = config; diff --git a/plugins/add-redirects-file.js b/plugins/add-redirects-file.js new file mode 100644 index 00000000..3a705c4a --- /dev/null +++ b/plugins/add-redirects-file.js @@ -0,0 +1,39 @@ +const path = require("path"); +const fs = require("fs"); + +/** + * function to add our redirects after build + * @param {object} props - the `props` object returned from postBuild + */ +function addRedirectsFile(props) { + const redirectFileName = "_redirects"; + const redirectFilePath = path.basename(redirectFileName); + + const destinationDirectory = props.outDir; + + if (!redirectFilePath) { + console.error(`⚠️ Redirect file does not exist!`); + return; + } + + if (!fs.existsSync(destinationDirectory)) { + console.error( + `⚠️ Build directory "${destinationDirectory} does not exist.` + ); + return; + } + + // Construct the destination file path + const destinationFilePath = path.join(destinationDirectory, redirectFileName); + + // Copy the file + fs.copyFile(redirectFilePath, destinationFilePath, (err) => { + if (err) { + console.error(`Error copying file: ${err}`); + return; + } + console.log(`_redirects copied to ${destinationDirectory}`); + }); +} + +export { addRedirectsFile }; diff --git a/plugins/create-link-file.js b/plugins/create-link-file.js new file mode 100644 index 00000000..5d922275 --- /dev/null +++ b/plugins/create-link-file.js @@ -0,0 +1,19 @@ +const { writeFileSync } = require("fs"); + +/** + * function create a file with all links + * this is a temp plugin to help us restructure our page + * without missing any links that need redirects + * @param {object} props - the `props` object returned from postBuild + */ +function createLinkFile(props) { + const routes = JSON.stringify(props.routesPaths, null, 2); + const filePath = "./current-routes.json"; + + // Write the routes to the file + writeFileSync(filePath, routes, "utf-8"); + + console.log(`Routes paths have been saved to ${filePath}`); +} + +export { createLinkFile }; diff --git a/sidebars.js b/sidebars.js index f0651ffd..b65ae49d 100644 --- a/sidebars.js +++ b/sidebars.js @@ -13,19 +13,48 @@ /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ const sidebars = { - // By default, Docusaurus generates a sidebar from the docs folder structure - tutorialSidebar: [{ type: "autogenerated", dirName: "." }], - - // But you can create a sidebar manually - - // tutorialSidebar: [ - // 'getstarted', - // { - // type: 'category', - // label: 'Concepts', - // items: ['Concepts/clusters-environments'], - // }, - // ], + docs: [ + "index", + "quickstart", + "features", + "getstarted", + { + type: "category", + label: "Concepts", + items: [ + { + type: "autogenerated", + dirName: "Concepts", // Generate sidebar slice from docs/concepts + }, + ], + }, + { + type: "category", + label: "HowTo", + items: [ + { + type: "autogenerated", + dirName: "HowTo", // Generate sidebar slice from docs/howTo + }, + ], + }, + "faq", + ], + releases: [ + { + type: "category", + label: "All releases", + link: { type: "generated-index", slug: "releases" }, + collapsed: false, + collapsible: false, + items: [ + { + type: "autogenerated", + dirName: "releases", // Generate sidebar slices from docs/releases + }, + ], + }, + ], }; module.exports = sidebars;