Skip to content

Commit 48007b8

Browse files
committed
format
1 parent 2fea31c commit 48007b8

File tree

5 files changed

+16
-12
lines changed

5 files changed

+16
-12
lines changed

src/common/Util.res

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,11 @@ module Date = {
8080
}
8181
}
8282

83-
8483
let removeVersionFromPathname = (pathname: string) =>
85-
pathname->Stdlib.String.split("/")->Array.filter(s => {
84+
pathname
85+
->Stdlib.String.split("/")
86+
->Array.filter(s => {
8687
let isVersion = s->Stdlib.String.includes("v") && s->Stdlib.String.includes(".")
8788
!isVersion
8889
})
89-
->Array.join("/")
90+
->Array.join("/")

src/common/Util.resi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,4 @@ module Date: {
1515
let toDayMonthYear: Date.t => string
1616
}
1717

18-
19-
let removeVersionFromPathname: string => string
18+
let removeVersionFromPathname: string => string

src/components/CodeExample.res

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
@directive("use client")
2-
32
let langShortname = (lang: string) =>
43
switch lang {
54
| "ocaml" => "ml"

src/layouts/ApiOverviewLayout.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ let makeCategories: string => array<Sidebar.Category.t> = version => [
55
name: "Overview",
66
items: [
77
{name: "Introduction", href: `/docs/manual/${version}/api`},
8-
{name: "Core", href: `/docs/manual/${version}/api/core`}
8+
{name: "Core", href: `/docs/manual/${version}/api/core`},
99
],
1010
},
1111
{

src/layouts/SidebarLayout.res

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,14 @@ module Sidebar = {
133133
None
134134
}
135135

136-
let { pathname } = Next.Router.useRouter()
136+
let {pathname} = Next.Router.useRouter()
137137

138-
<>
138+
<>
139139
<div
140140
id="sidebar"
141141
className={(
142142
isOpen ? "fixed w-full left-0 h-full z-20 min-w-320" : "hidden "
143143
) ++ " md:block md:w-48 md:-ml-4 lg:w-1/5 h-auto md:relative overflow-y-visible bg-white mt-28 md:mt-0"}>
144-
145144
<aside
146145
id="sidebar-content"
147146
className="relative top-0 px-4 w-full block md:pt-10 md:top-[7rem] md:sticky border-r border-gray-20 overflow-y-auto pb-24 h-auto max-h-[calc(100vh-7rem)]">
@@ -154,8 +153,14 @@ module Sidebar = {
154153
<Icon.Close />
155154
</button>
156155
<div className="mb-4">
157-
<p className="text-11">{React.string("You are viewing an older version of the documentation.")}</p>
158-
<a className="text-11 text-fire-30 border-b border-fire" href={`https://rescript-lang.org${pathname->Util.removeVersionFromPathname}`}>{React.string("Go to the latest version.")}</a>
156+
<p className="text-11">
157+
{React.string("You are viewing an older version of the documentation.")}
158+
</p>
159+
<a
160+
className="text-11 text-fire-30 border-b border-fire"
161+
href={`https://rescript-lang.org${pathname->Util.removeVersionFromPathname}`}>
162+
{React.string("Go to the latest version.")}
163+
</a>
159164
</div>
160165
<div className="flex justify-between">
161166
<div className="w-3/4 md:w-full"> toplevelNav </div>

0 commit comments

Comments
 (0)