From 9b9d49d90ed634ac9250e67794e806c5b0e66ae6 Mon Sep 17 00:00:00 2001 From: zahidalidev Date: Thu, 3 Apr 2025 23:49:54 +0500 Subject: [PATCH 1/3] Dynamic base path --- next.config.js | 2 +- src/components/Logo.tsx | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/next.config.js b/next.config.js index b521a8d58..6e13ab3fd 100644 --- a/next.config.js +++ b/next.config.js @@ -13,7 +13,7 @@ const nextConfig = { // VERCEL_ENV is a system env var set by Vercel // https://vercel.com/docs/projects/environment-variables/system-environment-variables // basePath: process.env.VERCEL_ENV === 'production' ? '/docs' : '', - basePath: '/docs', + basePath: process.env.VERCEL_ENV === 'production' ? '/docs' : '', // async redirects() { // return [ // ...updatedRedirectsData, diff --git a/src/components/Logo.tsx b/src/components/Logo.tsx index 1e11b6b7c..3dcfaf59c 100644 --- a/src/components/Logo.tsx +++ b/src/components/Logo.tsx @@ -1,16 +1,18 @@ export function Logo(props: React.ComponentPropsWithoutRef<'svg'>) { const basePath = process.env.VERCEL_ENV === 'production' ? '/docs' : '' + console.log('Doc Environment', process.env.VERCEL_ENV, basePath) + return ( <> Sourcegraph Docs Sourcegraph Docs From bd37670c398b6b924d34e815415448d92b87e273 Mon Sep 17 00:00:00 2001 From: zahidalidev Date: Thu, 3 Apr 2025 23:59:25 +0500 Subject: [PATCH 2/3] Code Refactoring --- src/components/Logo.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/Logo.tsx b/src/components/Logo.tsx index 3dcfaf59c..acaff9d34 100644 --- a/src/components/Logo.tsx +++ b/src/components/Logo.tsx @@ -1,8 +1,6 @@ export function Logo(props: React.ComponentPropsWithoutRef<'svg'>) { const basePath = process.env.VERCEL_ENV === 'production' ? '/docs' : '' - console.log('Doc Environment', process.env.VERCEL_ENV, basePath) - return ( <> Date: Sat, 12 Apr 2025 17:35:19 +0500 Subject: [PATCH 3/3] Fixed graphql api docs sidebar UI --- src/app/api/graphql/api-docs/page.tsx | 3 ++- src/components/Prose.tsx | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/app/api/graphql/api-docs/page.tsx b/src/app/api/graphql/api-docs/page.tsx index 3a78dc47a..0a876c995 100644 --- a/src/app/api/graphql/api-docs/page.tsx +++ b/src/app/api/graphql/api-docs/page.tsx @@ -15,7 +15,8 @@ const PostLayout = () => {