Skip to content

Commit 06e3824

Browse files
committed
add docs page
1 parent f46cc04 commit 06e3824

File tree

8 files changed

+16
-14
lines changed

8 files changed

+16
-14
lines changed

app/routes.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ let $$default = Belt_Array.concatMany([
4747
Routes.route("blog/archived", "./routes/BlogRoute.mjs", {
4848
id: "blog-archived"
4949
}),
50+
Routes.route("docs", "./routes/DocsOverview.mjs", {
51+
id: "docs-overview"
52+
}),
5053
Routes.route("docs/manual/api/stdlib", "./routes/ApiRoute.mjs", {
5154
id: "api-stdlib"
5255
}),

app/routes.res

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ let default = [
3535
route("syntax-lookup", "./routes/SyntaxLookupRoute.mjs", ~options={id: "syntax-lookup"}),
3636
route("blog", "./routes/BlogRoute.mjs", ~options={id: "blog-index"}),
3737
route("blog/archived", "./routes/BlogRoute.mjs", ~options={id: "blog-archived"}),
38+
route("docs", "./routes/DocsOverview.mjs", ~options={id: "docs-overview"}),
3839
route("docs/manual/api/stdlib", "./routes/ApiRoute.mjs", ~options={id: "api-stdlib"}),
3940
route("docs/manual/api/introduction", "./routes/ApiRoute.mjs", ~options={id: "api-intro"}),
4041
route("docs/manual/api/belt", "./routes/ApiRoute.mjs", ~options={id: "api-belt"}),
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module Card = {
55
<h2 className="font-bold text-24 mb-4"> {React.string(title)} </h2>
66
<ul>
77
{Array.map(hrefs, ((text, href)) =>
8-
<li key=text className="text-16 mb-1 last:mb-0">
8+
<li key=text className="text-16 mb-1 last:mb-0 text-fire hover:underline">
99
<ReactRouter.Link.String to=href> {React.string(text)} </ReactRouter.Link.String>
1010
</li>
1111
)->React.array}
@@ -30,15 +30,16 @@ let default = (~showVersionSelect=true) => {
3030
("Reanalyze", "https://github.com/rescript-lang/reanalyze"),
3131
]
3232

33-
<>
34-
<div>
35-
<div className="mb-6" />
33+
<MainLayout>
34+
<div className="max-w-740 w-full m-auto mt-16 md:mt-6">
35+
// <div className="mb-6" />
3636
<Markdown.H1> {React.string("Docs")} </Markdown.H1>
37+
38+
<div className="grid grid-cols-1 xs:grid-cols-2 gap-8">
39+
<Card title="Language Manual" hrefs=languageManual />
40+
<Card title="Ecosystem" hrefs=ecosystem />
41+
<Card title="Tools" hrefs=Constants.tools />
42+
</div>
3743
</div>
38-
<div className="grid grid-cols-1 xs:grid-cols-2 gap-8">
39-
<Card title="Language Manual" hrefs=languageManual />
40-
<Card title="Ecosystem" hrefs=ecosystem />
41-
<Card title="Tools" hrefs=Constants.tools />
42-
</div>
43-
</>
44+
</MainLayout>
4445
}

src/Packages.res

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,6 @@ let make = (props: props) => {
431431
/>
432432
<div className="mt-16 pt-2">
433433
<div className="text-gray-80 text-18">
434-
// <Navigation isOverlayOpen setOverlayOpen />
435434
<div className="flex overflow-hidden">
436435
<div
437436
className="flex justify-between min-w-320 px-4 pt-16 lg:align-center w-full lg:px-8 pb-48"

src/SyntaxLookup.res

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,6 @@ let make = (
387387
/>
388388
<div className="mt-4 xs:mt-16">
389389
<div className="text-gray-80">
390-
// <Navigation isOverlayOpen setOverlayOpen />
391390
<div className="flex xs:justify-center overflow-hidden pb-48">
392391
<main className="mt-24 min-w-320 lg:align-center w-full px-4 md:px-8 max-w-1280">
393392
<div className="flex justify-center">

src/components/Navigation.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ let isActiveLink = (~includes: string, ~excludes: option<string>=?, ~route: Path
2222

2323
let isDocRoute = (~route: Path.t) => {
2424
let route = (route :> string)
25-
route->String.includes("/docs/") || route->String.includes("/syntax-lookup")
25+
route->String.includes("/docs/") || route->String.includes("/syntax-lookup") || route == "/docs"
2626
}
2727

2828
let isDocRouteActive = (~route: Path.t) => isDocRoute(~route) ? activeLink : link

src/layouts/MainLayout.res

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ let make = (~components=MarkdownComponents.default, ~children) => {
55
<>
66
<div className={"mt-4 xs:mt-16"}>
77
<div className="text-gray-80">
8-
// <Navigation isOverlayOpen setOverlayOpen />
98
<div className="flex xs:justify-center overflow-hidden pb-48">
109
<main className="mt-16 min-w-320 lg:align-center w-full px-4 md:px-8 max-w-1280 ">
1110
children

0 commit comments

Comments
 (0)