File tree

9 files changed

+16
-53
lines changed

9 files changed

+16
-53
lines changed
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ module SidebarTree = {
164164

165165
let preludeSection =
166166
<div className="flex justify-between text-fire font-medium items-baseline">
167-
{React.string(node.name ++ " Module")}
168167
{switch url {
169168
| Some(url) =>
170169
let onChange = evt => {
@@ -207,7 +206,7 @@ module SidebarTree = {
207206
) ++ " md:block md:w-48 md:-ml-4 lg:w-1/5 md:h-auto md:relative overflow-y-visible bg-white"}>
208207
<aside
209208
id="sidebar-content"
210-
className="relative top-0 px-4 w-full block md:top-16 md:pt-16 md:sticky border-r border-gray-20 overflow-y-auto pb-24 h-[calc(100vh-4.5rem)]">
209+
className="relative top-0 px-4 w-full block md:top-[7rem] md:pt-10 md:sticky border-r border-gray-20 overflow-y-auto pb-24 h-[calc(100vh-7rem)]">
211210
<div className="flex justify-between">
212211
<div className="w-3/4 md:w-full"> React.null </div>
213212
<button
@@ -350,7 +349,7 @@ let default = (props: props) => {
350349
| Ok({module_: {items}}) if Array.length(items) > 0 =>
351350
<div className="hidden xl:block lg:w-1/5 md:h-auto md:relative overflow-y-visible bg-white">
352351
<aside
353-
className="relative top-0 pl-4 w-full block md:top-16 md:pt-16 md:sticky border-l border-gray-20 overflow-y-auto pb-24 h-[calc(100vh-4.5rem)]">
352+
className="relative top-0 pl-4 w-full block md:top-[7rem] md:pt-4 md:sticky border-l border-gray-20 overflow-y-auto pb-24 h-[calc(100vh-7rem)]">
354353
<div className="hl-overline block text-gray-80 mt-16 mb-2">
355354
{"Types and values"->React.string}
356355
</div>
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ let make = (
9898

9999
let preludeSection =
100100
<div className="flex justify-between text-fire font-medium items-baseline">
101-
{React.string(title)}
102101
{switch version {
103102
| Some(version) =>
104103
let onChange = evt => {
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ let makeCategories: string => array<Sidebar.Category.t> = version => [
2525
module Docs = {
2626
@react.component
2727
let make = (~version, ~components=ApiMarkdown.default, ~children) => {
28-
let title = "API"
2928
let categories = makeCategories(version)
3029

31-
<ApiLayout title categories version components> children </ApiLayout>
30+
<ApiLayout categories version components> children </ApiLayout>
3231
}
3332
}
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ module CommunityLayout = DocsLayout.Make({
77
let make = (~frontmatter=?, ~components=MarkdownComponents.default, ~children) => {
88
let breadcrumbs = list{{Url.name: "Community", href: "/community"}}
99

10-
let title = "Community"
11-
1210
<CommunityLayout
13-
theme=#Reason components metaTitleCategory="ReScript Community" title breadcrumbs ?frontmatter>
11+
theme=#Reason components metaTitleCategory="ReScript Community" breadcrumbs ?frontmatter>
1412
children
1513
</CommunityLayout>
1614
}
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ let makeBreadcrumbs = (~basePath: string, route: string): list<Url.breadcrumb> =
4949
@react.component
5050
let make = (
5151
~breadcrumbs: option<list<Url.breadcrumb>>=?,
52-
~title: string,
53-
~metaTitleCategory: option<string>=?, // e.g. Introduction | My Meta Title Category
52+
~metaTitleCategory: string, // e.g. Introduction | My Meta Title Category
5453
~frontmatter=?,
5554
~version: option<string>=?,
5655
~availableVersions: option<array<(string, string)>>=?,
@@ -86,7 +85,6 @@ let make = (
8685

8786
let preludeSection =
8887
<div className="flex flex-col justify-between text-fire font-medium items-baseline">
89-
{React.string(title)}
9088
{switch version {
9189
| Some(version) =>
9290
switch availableVersions {
@@ -111,30 +109,23 @@ let make = (
111109
</div>
112110

113111
let sidebar =
114-
<Sidebar
115-
isOpen=isSidebarOpen toggle=toggleSidebar preludeSection title ?activeToc categories route
116-
/>
112+
<Sidebar isOpen=isSidebarOpen toggle=toggleSidebar preludeSection ?activeToc categories route />
117113

118-
let metaTitle = switch metaTitleCategory {
119-
| Some(titleCategory) => titleCategory ++ (" | " ++ "ReScript Documentation")
120-
| None => title
121-
}
114+
let metaTitle = metaTitleCategory ++ (" | " ++ "ReScript Documentation")
122115

123116
let (metaElement, editHref) = switch frontmatter {
124117
| Some(frontmatter) =>
125118
switch DocFrontmatter.decode(frontmatter) {
126119
| Some(fm) =>
127120
let canonical = Null.toOption(fm.canonical)
128121
let description = Null.toOption(fm.description)
129-
let title = switch metaTitleCategory {
130-
| Some(titleCategory) =>
122+
let title = {
131123
// We will prefer an existing metaTitle over just a title
132124
let metaTitle = switch Null.toOption(fm.metaTitle) {
133125
| Some(metaTitle) => metaTitle
134126
| None => fm.title
135127
}
136-
metaTitle ++ (" | " ++ titleCategory)
137-
| None => title
128+
metaTitle ++ (" | " ++ metaTitleCategory)
138129
}
139130
let meta = <Meta title ?description ?canonical version=Url.parse(router.route).version />
140131

@@ -173,8 +164,7 @@ module Make = (Content: StaticContent) => {
173164
let make = (
174165
// base breadcrumbs without the very last element (the currently shown document)
175166
~breadcrumbs: option<list<Url.breadcrumb>>=?,
176-
~title: string,
177-
~metaTitleCategory: option<string>=?,
167+
~metaTitleCategory: string,
178168
~frontmatter=?,
179169
~version: option<string>=?,
180170
~availableVersions: option<array<(string, string)>>=?,
@@ -235,8 +225,7 @@ module Make = (Content: StaticContent) => {
235225

236226
make({
237227
?breadcrumbs,
238-
title,
239-
?metaTitleCategory,
228+
metaTitleCategory,
240229
?frontmatter,
241230
?version,
242231
?availableVersions,
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ let makeBreadcrumbs: (~basePath: string, string) => list<Url.breadcrumb>
44
@react.component
55
let make: (
66
~breadcrumbs: list<Url.breadcrumb>=?,
7-
~title: string,
8-
~metaTitleCategory: string=?, // e.g. Introduction | My Meta Title Category
7+
~metaTitleCategory: string, // e.g. Introduction | My Meta Title Category
98
~frontmatter: JSON.t=?,
109
~version: string=?,
1110
~availableVersions: array<(string, string)>=?,
@@ -27,8 +26,7 @@ module Make: (Content: StaticContent) =>
2726
@react.component
2827
let make: (
2928
~breadcrumbs: list<Url.breadcrumb>=?,
30-
~title: string,
31-
~metaTitleCategory: string=?,
29+
~metaTitleCategory: string,
3230
~frontmatter: JSON.t=?,
3331
~version: string=?,
3432
~availableVersions: array<(string, string)>=?,
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ module V1200Layout = DocsLayout.Make({
2626
module V1200 = {
2727
@react.component
2828
let make = (~frontmatter=?, ~components=MarkdownComponents.default, ~children) => {
29-
let title = "Language Manual"
3029
let router = Next.Router.useRouter()
3130
let url = router.route->Url.parse
3231
let version = url->Url.getVersionString
@@ -59,7 +58,6 @@ module V1200 = {
5958
theme=#Reason
6059
components
6160
version
62-
title
6361
metaTitleCategory="ReScript Language Manual"
6462
availableVersions=Constants.allManualVersions
6563
nextVersion=?Constants.nextVersion
@@ -74,7 +72,6 @@ module V1200 = {
7472
module V1100 = {
7573
@react.component
7674
let make = (~frontmatter=?, ~components=MarkdownComponents.default, ~children) => {
77-
let title = "Language Manual"
7875
let router = Next.Router.useRouter()
7976
let version = router.route->Url.parse->Url.getVersionString
8077

@@ -87,7 +84,6 @@ module V1100 = {
8784
theme=#Reason
8885
components
8986
version
90-
title
9187
metaTitleCategory="ReScript Language Manual"
9288
availableVersions=Constants.allManualVersions
9389
nextVersion=?Constants.nextVersion
@@ -122,13 +118,12 @@ module V1000 = {
122118
},
123119
}
124120

125-
let title = "Language Manual"
121+
// let title = "Language Manual"
126122

127123
<V1000Layout
128124
theme=#Reason
129125
components
130126
version
131-
title
132127
metaTitleCategory="ReScript Language Manual"
133128
availableVersions=Constants.allManualVersions
134129
nextVersion=?Constants.nextVersion
@@ -167,13 +162,10 @@ module V900 = {
167162
},
168163
}
169164

170-
let title = "Language Manual"
171-
172165
<V900Layout
173166
theme=#Reason
174167
components
175168
version
176-
title
177169
metaTitleCategory="ReScript Language Manual"
178170
availableVersions=Constants.allManualVersions
179171
nextVersion=?Constants.nextVersion
@@ -208,7 +200,6 @@ module V800 = {
208200
},
209201
}
210202

211-
let title = "Language Manual"
212203
let version = "v8.0.0"
213204

214205
let warnBanner = {
@@ -249,7 +240,6 @@ module V800 = {
249240
theme=#Reason
250241
components
251242
version
252-
title
253243
metaTitleCategory="ReScript Language Manual"
254244
availableVersions=Constants.allManualVersions
255245
nextVersion=?Constants.nextVersion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ module Latest = {
3636
{name: "rescript-react", href: "/docs/react/" ++ (version ++ "/introduction")},
3737
}
3838

39-
let title = "rescript-react"
4039
let version = "latest"
4140

4241
<LatestLayout
@@ -45,7 +44,6 @@ module Latest = {
4544
metaTitleCategory="React"
4645
availableVersions=Constants.allReactVersions
4746
version
48-
title
4947
breadcrumbs
5048
?frontmatter>
5149
children
@@ -70,15 +68,12 @@ module V0110 = {
7068
{name: "rescript-react", href: "/docs/react/" ++ (version ++ "/introduction")},
7169
}
7270

73-
let title = "rescript-react"
74-
7571
<V0110Layout
7672
theme=#Reason
7773
components
7874
metaTitleCategory="React"
7975
availableVersions=Constants.allReactVersions
8076
version
81-
title
8277
breadcrumbs
8378
?frontmatter>
8479
children
@@ -103,15 +98,12 @@ module V0100 = {
10398
{name: "rescript-react", href: "/docs/react/" ++ (version ++ "/introduction")},
10499
}
105100

106-
let title = "rescript-react"
107-
108101
<V0100Layout
109102
theme=#Reason
110103
components
111104
metaTitleCategory="React"
112105
availableVersions=Constants.allReactVersions
113106
version
114-
title
115107
breadcrumbs
116108
?frontmatter>
117109
children
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,10 @@ module Sidebar = {
138138
id="sidebar"
139139
className={(
140140
isOpen ? "fixed w-full left-0 h-full z-20 min-w-320" : "hidden "
141-
) ++ " overflow-x-hidden md:block md:w-48 md:-ml-4 lg:w-1/5 md:h-auto md:relative overflow-y-visible bg-white mt-28 md:mt-0"}>
141+
) ++ " md:block md:w-48 md:-ml-4 lg:w-1/5 md:h-auto md:relative overflow-y-visible bg-white mt-28 md:mt-0"}>
142142
<aside
143143
id="sidebar-content"
144-
className="relative top-0 px-4 w-full block md:top-16 md:pt-4 md:sticky border-r border-gray-20 overflow-y-auto pb-24"
145-
style={ReactDOMStyle.make(~height="calc(100vh - 4.5rem", ())}>
144+
className="relative top-0 px-4 w-full block md:top-[7rem] md:pt-10 md:sticky border-r border-gray-20 overflow-y-auto pb-24 h-[calc(100vh-7rem)]">
146145
<button
147146
onClick={evt => {
148147
ReactEvent.Mouse.preventDefault(evt)

0 commit comments

Comments
 (0)