From 00c2cb29612d70e0cdbee7fbe2917ab194401917 Mon Sep 17 00:00:00 2001 From: Codexnever Date: Sat, 5 Oct 2024 11:47:12 +0530 Subject: [PATCH] Fix dynamic `editUrl` path for documentation subfolder structure --- docusaurus.config.js | 9 +++++---- package-lock.json | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docusaurus.config.js b/docusaurus.config.js index 939b4ec1..efffaf88 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -41,10 +41,11 @@ const config = { /** @type {import('@docusaurus/preset-classic').Options} */ ({ docs: { - sidebarPath: './sidebars.js', - // Please change this to your repo. - editUrl: - 'https://github.com/open-sauced/intro', + sidebarPath: require.resolve('./sidebars.js'), + path: './docs', + // Dynamic editUrl construction + editUrl: ({ versionDocsDirPath, docPath }) => + `https://github.com/open-sauced/intro/edit/main/${versionDocsDirPath}/${docPath}`, routeBasePath: '/', }, theme: { diff --git a/package-lock.json b/package-lock.json index e2d651c0..1d0c7e07 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "courses", + "name": "@open-sauced/intro.opensauced.pizza", "version": "0.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "courses", + "name": "@open-sauced/intro.opensauced.pizza", "version": "0.0.0", "dependencies": { "@docusaurus/core": "3.4.0",