Skip to content

Commit 0e82c68

Browse files
committed
Remove React docs sidebar and breadcrumbs logic
1 parent 01770da commit 0e82c68

1 file changed

Lines changed: 2 additions & 33 deletions

File tree

app/routes/MdxRoute.res

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -99,22 +99,6 @@ let manualTableOfContents = async () => {
9999
categories
100100
}
101101

102-
let reactTableOfContents = async () => {
103-
let groups =
104-
(await allMdx(~filterByPaths=["markdown-pages/docs"]))
105-
->filterMdxPages("docs/react")
106-
->groupBySection
107-
->Dict.mapValues(values => values->sortSection->convertToNavItems("/docs/react"))
108-
109-
// these are the categories that appear in the sidebar
110-
let categories: array<SidebarLayout.Sidebar.Category.t> = getAllGroups(
111-
groups,
112-
["Overview", "Main Concepts", "Hooks & State Management", "Guides"],
113-
)
114-
115-
categories
116-
}
117-
118102
let communityTableOfContents = async () => {
119103
let groups =
120104
(await allMdx(~filterByPaths=["markdown-pages/community"]))
@@ -163,8 +147,6 @@ let loader: ReactRouter.Loader.t<loaderData> = async ({request}) => {
163147
[]
164148
} else if pathname->String.includes("docs/manual") {
165149
await manualTableOfContents()
166-
} else if pathname->String.includes("docs/react") {
167-
await reactTableOfContents()
168150
} else if pathname->String.includes("community") {
169151
await communityTableOfContents()
170152
} else {
@@ -222,21 +204,11 @@ let loader: ReactRouter.Loader.t<loaderData> = async ({request}) => {
222204
href: "/docs/manual/" ++ "introduction",
223205
},
224206
})
225-
: pathname->String.includes("docs/react")
226-
? Some(list{
227-
{Url.name: "Docs", href: "/docs/"},
228-
{
229-
Url.name: "rescript-react",
230-
href: "/docs/react/" ++ "introduction",
231-
},
232-
})
233207
: None
234208

235209
let metaTitleCategory = {
236210
let path = (pathname :> string)
237-
let title = if path->String.includes("docs/react") {
238-
"ReScript React"
239-
} else if path->String.includes("docs/manual/api") {
211+
let title = if path->String.includes("docs/manual/api") {
240212
"ReScript API"
241213
} else if path->String.includes("docs/manual") {
242214
"ReScript Language Manual"
@@ -322,8 +294,7 @@ let default = () => {
322294
</>
323295
} else if (
324296
(pathname :> string)->String.includes("docs/manual") ||
325-
(pathname :> string)->String.includes("docs/react") ||
326-
(pathname :> string)->String.includes("docs/guidelines")
297+
(pathname :> string)->String.includes("docs/guidelines")
327298
) {
328299
<>
329300
<Meta title=title description={attributes.description->Nullable.getOr("")} />
@@ -334,8 +305,6 @@ let default = () => {
334305
if index === 0 {
335306
if (pathname :> string)->String.includes("docs/manual") {
336307
{...item, href: "/docs/manual/introduction"}
337-
} else if (pathname :> string)->String.includes("docs/react") {
338-
{...item, href: "/docs/react/introduction"}
339308
} else {
340309
item
341310
}

0 commit comments

Comments
 (0)