Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcfb1f40

Browse files
authored
Remove duplicate title and fix left sidebar position (#1057)
1 parenta555b8c commitcfb1f40

File tree

9 files changed

+16
-53
lines changed

9 files changed

+16
-53
lines changed

‎src/ApiDocs.res‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ module SidebarTree = {
164164

165165
letpreludeSection=
166166
<divclassName="flex justify-between text-fire font-medium items-baseline">
167-
{React.string(node.name++" Module")}
168167
{switchurl {
169168
|Some(url)=>
170169
letonChange=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
<divclassName="flex justify-between">
212211
<divclassName="w-3/4 md:w-full">React.null </div>
213212
<button
@@ -350,7 +349,7 @@ let default = (props: props) => {
350349
|Ok({module_: {items}})ifArray.length(items) >0=>
351350
<divclassName="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
<divclassName="hl-overline block text-gray-80 mt-16 mb-2">
355354
{"Types and values"->React.string}
356355
</div>

‎src/layouts/ApiLayout.res‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ let make = (
9898

9999
letpreludeSection=
100100
<divclassName="flex justify-between text-fire font-medium items-baseline">
101-
{React.string(title)}
102101
{switchversion {
103102
|Some(version)=>
104103
letonChange=evt=> {

‎src/layouts/ApiOverviewLayout.res‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ let makeCategories: string => array<Sidebar.Category.t> = version => [
2525
moduleDocs= {
2626
@react.component
2727
letmake= (~version, ~components=ApiMarkdown.default, ~children)=> {
28-
lettitle="API"
2928
letcategories=makeCategories(version)
3029

31-
<ApiLayouttitlecategoriesversioncomponents>children </ApiLayout>
30+
<ApiLayoutcategoriesversioncomponents>children </ApiLayout>
3231
}
3332
}

‎src/layouts/CommunityLayout.res‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ module CommunityLayout = DocsLayout.Make({
77
letmake= (~frontmatter=?, ~components=MarkdownComponents.default, ~children)=> {
88
letbreadcrumbs=list{{Url.name:"Community",href:"/community"}}
99

10-
lettitle="Community"
11-
1210
<CommunityLayout
13-
theme=#ReasoncomponentsmetaTitleCategory="ReScript Community"titlebreadcrumbs ?frontmatter>
11+
theme=#ReasoncomponentsmetaTitleCategory="ReScript Community"breadcrumbs ?frontmatter>
1412
children
1513
</CommunityLayout>
1614
}

‎src/layouts/DocsLayout.res‎

Lines changed: 7 additions & 18 deletions
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
letmake= (
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
letpreludeSection=
8887
<divclassName="flex flex-col justify-between text-fire font-medium items-baseline">
89-
{React.string(title)}
9088
{switchversion {
9189
|Some(version)=>
9290
switchavailableVersions {
@@ -111,30 +109,23 @@ let make = (
111109
</div>
112110

113111
letsidebar=
114-
<Sidebar
115-
isOpen=isSidebarOpentoggle=toggleSidebarpreludeSectiontitle ?activeToccategoriesroute
116-
/>
112+
<SidebarisOpen=isSidebarOpentoggle=toggleSidebarpreludeSection ?activeToccategoriesroute />
117113

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

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

@@ -173,8 +164,7 @@ module Make = (Content: StaticContent) => {
173164
letmake= (
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,

‎src/layouts/DocsLayout.resi‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ let makeBreadcrumbs: (~basePath: string, string) => list<Url.breadcrumb>
44
@react.component
55
letmake: (
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
letmake: (
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)>=?,

‎src/layouts/ManualDocsLayout.res‎

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ module V1200Layout = DocsLayout.Make({
2626
moduleV1200= {
2727
@react.component
2828
letmake= (~frontmatter=?, ~components=MarkdownComponents.default, ~children)=> {
29-
lettitle="Language Manual"
3029
letrouter=Next.Router.useRouter()
3130
leturl=router.route->Url.parse
3231
letversion=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
moduleV1100= {
7573
@react.component
7674
letmake= (~frontmatter=?, ~components=MarkdownComponents.default, ~children)=> {
77-
lettitle="Language Manual"
7875
letrouter=Next.Router.useRouter()
7976
letversion=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-
lettitle="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-
lettitle="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-
lettitle="Language Manual"
212203
letversion="v8.0.0"
213204

214205
letwarnBanner= {
@@ -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

‎src/layouts/ReactDocsLayout.res‎

Lines changed: 0 additions & 8 deletions
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-
lettitle="rescript-react"
4039
letversion="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-
lettitle="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-
lettitle="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

‎src/layouts/SidebarLayout.res‎

Lines changed: 2 additions & 3 deletions
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-hiddenmd: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)

[8]ページ先頭

©2009-2025 Movatter.jp