Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions app/routes/MdxRoute.res
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,10 @@ let loader: ReactRouter.Loader.t<loaderData> = 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
})
Expand Down Expand Up @@ -289,6 +290,8 @@ let default = () => {

let {entries, categories, title} = loaderData

Console.log(loaderData)

<>
{if (pathname :> string) == "/docs/manual/api" {
<>
Expand Down