From 5224c82b502aeaef0fe269e114488faa8ea28655 Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Sun, 30 Jun 2024 00:36:14 -0700 Subject: [PATCH] Fix docs search API endpoint (#141) --- docs/app/source.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/app/source.ts b/docs/app/source.ts index 969f128e..981304fe 100644 --- a/docs/app/source.ts +++ b/docs/app/source.ts @@ -1,11 +1,14 @@ import { join } from 'node:path'; import { readdirSync } from 'node:fs'; -import { fileURLToPath } from 'node:url'; import { map } from '@/.map'; import { createMDXSource } from 'fumadocs-mdx'; import { loader } from 'fumadocs-core/source'; -const contentDir = join(fileURLToPath(import.meta.url), '../../content'); +const dirnameParts = __dirname.split('/'); +const docsDir = dirnameParts + .slice(0, dirnameParts.indexOf('docs') + 1) + .join('/'); +const contentDir = join(docsDir, 'content'); export const loaders: Map< string,