From f5bad8c72ea45b2072d4a5288c1393ee8008b32e Mon Sep 17 00:00:00 2001 From: Raffaele Lungarella Date: Wed, 28 Jan 2026 17:33:36 +0100 Subject: [PATCH] Update filePath to be correct regardless of deployment environment --- app/routes/MdxRoute.res | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/routes/MdxRoute.res b/app/routes/MdxRoute.res index 489734af6..3f3eebbe8 100644 --- a/app/routes/MdxRoute.res +++ b/app/routes/MdxRoute.res @@ -200,9 +200,10 @@ let loader: ReactRouter.Loader.t = async ({request}) => { ->Array.get(0) ->Option.flatMap(mdx => { filePath := - mdx.path->Option.map(mdxPath => - String.slice(mdxPath, ~start=mdxPath->String.indexOf("rescript-lang.org/") + 17) - ) + mdx.path->Option.map(mdxPath => { + Console.log2("mdxPath:", mdxPath) + String.slice(mdxPath, ~start=mdxPath->String.indexOf("/markdown-pages")) + }) // remove the filesystem path to get the relative path to the files in the repo mdx.path }) @@ -289,6 +290,8 @@ let default = () => { let {entries, categories, title} = loaderData + Console.log(loaderData) + <> {if (pathname :> string) == "/docs/manual/api" { <>