From cb031327ab638495992e5e2b6956454649fa9df3 Mon Sep 17 00:00:00 2001 From: Enrique Gonzalez Date: Wed, 26 Nov 2025 09:28:10 -0800 Subject: [PATCH] introduce vercel NEXT_PUBLIC_DOCS_BASE_PATH to avoid logo rendering to the wrong path --- next.config.js | 6 +++++- src/components/Logo.tsx | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/next.config.js b/next.config.js index 46364743d..b0b4aa4d9 100644 --- a/next.config.js +++ b/next.config.js @@ -11,7 +11,11 @@ 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: process.env.VERCEL_ENV === 'production' ? '/docs' : '' + basePath: process.env.VERCEL_ENV === 'production' ? '/docs' : '', + env: { + NEXT_PUBLIC_DOCS_BASE_PATH: + process.env.VERCEL_ENV === 'production' ? '/docs' : '' + } }; module.exports = async () => { diff --git a/src/components/Logo.tsx b/src/components/Logo.tsx index fe7d22dd6..82eec1921 100644 --- a/src/components/Logo.tsx +++ b/src/components/Logo.tsx @@ -1,5 +1,5 @@ export function Logo(props: React.ComponentPropsWithoutRef<'svg'>) { - const basePath = process.env.VERCEL_ENV === 'production' ? '/docs' : ''; + const basePath = process.env.NEXT_PUBLIC_DOCS_BASE_PATH || ''; return ( <>