From 3abb577c664ae2a67a642af1b74d665ffc98fbfa Mon Sep 17 00:00:00 2001 From: Badal Saibo Date: Thu, 16 Jan 2025 15:02:40 +0530 Subject: [PATCH 1/2] feat: edit url function --- docusaurus.config.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 105a51c..d91a11d 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -6,6 +6,14 @@ import type * as Preset from '@docusaurus/preset-classic'; const REPO_NAME = 'api'; const ORG_NAME = 'refrens-docs'; +const GITHUB_REPO_URL = `https://github.com/${ORG_NAME}/${REPO_NAME}`; + +const editUrlFunction = ({ docPath, versionDocsDirPath, ...restProps }) => { + for (const key in restProps) { + console.log(`${key}: ${restProps[key]}`); + } + return `${GITHUB_REPO_URL}/edit/main/${versionDocsDirPath}/${docPath}`; +}; const config: Config = { title: 'Refrens Documentation', @@ -41,7 +49,7 @@ const config: Config = { sidebarPath: './sidebars.ts', // Please change this to your repo. // Remove this to remove the "edit this page" links. - editUrl: `https://github.com/${ORG_NAME}/${REPO_NAME}`, + editUrl: editUrlFunction, routeBasePath: '/', }, blog: false, From e404ac4aa88793334bdb77898bcfc077e98a2d18 Mon Sep 17 00:00:00 2001 From: Badal Saibo Date: Thu, 16 Jan 2025 15:56:49 +0530 Subject: [PATCH 2/2] feat: edit url func --- docusaurus.config.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docusaurus.config.ts b/docusaurus.config.ts index d91a11d..10206bd 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -8,10 +8,7 @@ const REPO_NAME = 'api'; const ORG_NAME = 'refrens-docs'; const GITHUB_REPO_URL = `https://github.com/${ORG_NAME}/${REPO_NAME}`; -const editUrlFunction = ({ docPath, versionDocsDirPath, ...restProps }) => { - for (const key in restProps) { - console.log(`${key}: ${restProps[key]}`); - } +const editUrlFunction = ({ docPath, versionDocsDirPath }) => { return `${GITHUB_REPO_URL}/edit/main/${versionDocsDirPath}/${docPath}`; };