Skip to content

Commit 08487ac

Browse files
authored
fix: add dom routes to fix Storage and Storage2 404s (#1243)
1 parent 00a9390 commit 08487ac

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

app/routes.res

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ let stdlibPaths = {
1111
->Array.filter(path => path !== "docs/manual/api/stdlib")
1212
}
1313

14+
let domPaths = {
15+
let rawFile = await Node.Fs.readFile("./markdown-pages/docs/api/dom.json", "utf-8")
16+
let json = JSON.parseOrThrow(rawFile)
17+
switch json {
18+
| Object(json) => Dict.keysToArray(json)
19+
| _ => []
20+
}
21+
->Array.map(key => "docs/manual/api/" ++ key)
22+
->Array.filter(path => path !== "docs/manual/api/dom")
23+
}
24+
1425
let beltPaths = {
1526
let rawFile = await Node.Fs.readFile("./markdown-pages/docs/api/belt.json", "utf-8")
1627
let json = JSON.parseOrThrow(rawFile)
@@ -25,6 +36,9 @@ let beltPaths = {
2536
let stdlibRoutes =
2637
stdlibPaths->Array.map(path => route(path, "./routes/ApiRoute.jsx", ~options={id: path}))
2738

39+
let domRoutes =
40+
domPaths->Array.map(path => route(path, "./routes/ApiRoute.jsx", ~options={id: path}))
41+
2842
let beltRoutes =
2943
beltPaths->Array.map(path => route(path, "./routes/ApiRoute.jsx", ~options={id: path}))
3044

@@ -72,6 +86,7 @@ let default = [
7286
route("docs/manual/api/dom", "./routes/ApiRoute.jsx", ~options={id: "api-dom"}),
7387
...stdlibRoutes,
7488
...beltRoutes,
89+
...domRoutes,
7590
...blogArticleRoutes,
7691
...docsGuidelinesRoutes,
7792
...communityRoutes,

0 commit comments

Comments
 (0)