From fb03db43d2b6f8246e461a1dfc9076e0e59a5a19 Mon Sep 17 00:00:00 2001 From: Francois Best Date: Sat, 27 Jan 2024 08:24:22 +0100 Subject: [PATCH] doc: Trying a simpler approach --- .../app/playground/(demos)/_components/source-on-github.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/docs/src/app/playground/(demos)/_components/source-on-github.tsx b/packages/docs/src/app/playground/(demos)/_components/source-on-github.tsx index ac261afc6..51a72e39f 100644 --- a/packages/docs/src/app/playground/(demos)/_components/source-on-github.tsx +++ b/packages/docs/src/app/playground/(demos)/_components/source-on-github.tsx @@ -37,9 +37,7 @@ function readSourceCode(demoPath: string) { } const __dirname = path.dirname(fileURLToPath(import.meta.url)) -const indexOfDocs = __dirname.indexOf('/packages/docs') -export const nextJsRootDir = - __dirname.substring(0, indexOfDocs) + '/packages/docs' +const nextJsRootDir = path.resolve(__dirname, '../../../../..') function resolve(importMetaUrl: string, ...paths: string[]) { const filePath = fileURLToPath(importMetaUrl)