Skip to content

Commit 359405c

Browse files
committed
pr feedback
1 parent 5c4fb30 commit 359405c

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

app/routes/MdxRoute.res

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,12 @@ let loader: ReactRouter.Loader.t<loaderData> = async ({request}) => {
189189
// TODO POST RR7: extract this out into a separate function
190190
// it can probably be cached or something
191191
let fileContents = await (await allMdx())
192-
->Array.filter(mdx => mdx.path->Option.map(String.includes(_, pathname))->Option.getOr(false))
192+
->Array.filter(mdx => {
193+
switch mdx.slug {
194+
| Some(slug) => pathname->Util.String.camelCase->String.includes(slug->Util.String.camelCase)
195+
| None => false
196+
}
197+
})
193198
->Array.get(0)
194199
->Option.flatMap(mdx => {
195200
filePath :=
@@ -298,7 +303,7 @@ let default = () => {
298303
<Meta title=title description={attributes.description->Nullable.getOr("")} />
299304
<DocsLayout
300305
categories
301-
activeToc={title: "Introduction", entries}
306+
activeToc={title, entries}
302307
breadcrumbs=?{loaderData.breadcrumbs->Option.map(crumbs =>
303308
List.mapWithIndex(crumbs, (item, index) => {
304309
if index === 0 {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"build": "patch-package && rescript build && react-router build",
1818
"test": "node scripts/test-examples.mjs && node scripts/test-hrefs.mjs",
1919
"reanalyze": "reanalyze -all-cmt .",
20-
"update-index": "npm run generate-llms && && node scripts/generate_feed.mjs > public/blog/feed.xml",
20+
"update-index": "npm run generate-llms && node scripts/generate_feed.mjs > public/blog/feed.xml",
2121
"sync-bundles": "node scripts/sync-playground-bundles.mjs",
2222
"generate-llms": "node scripts/generate_llms.mjs",
2323
"format": "prettier . --write --experimental-cli && rescript format",
@@ -83,4 +83,4 @@
8383
"vite-plugin-devtools-json": "^1.0.0",
8484
"vite-plugin-env-compatible": "^2.0.1"
8585
}
86-
}
86+
}

0 commit comments

Comments
 (0)