File tree Expand file tree Collapse file tree 5 files changed +16
-12
lines changed Expand file tree Collapse file tree 5 files changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -80,10 +80,11 @@ module Date = {
80
80
}
81
81
}
82
82
83
-
84
83
let removeVersionFromPathname = (pathname : string ) =>
85
- pathname -> Stdlib .String .split ("/" )-> Array .filter (s => {
84
+ pathname
85
+ -> Stdlib .String .split ("/" )
86
+ -> Array .filter (s => {
86
87
let isVersion = s -> Stdlib .String .includes ("v" ) && s -> Stdlib .String .includes ("." )
87
88
! isVersion
88
89
})
89
- -> Array .join ("/" )
90
+ -> Array .join ("/" )
Original file line number Diff line number Diff line change @@ -15,5 +15,4 @@ module Date: {
15
15
let toDayMonthYear : Date .t => string
16
16
}
17
17
18
-
19
- let removeVersionFromPathname : string => string
18
+ let removeVersionFromPathname : string => string
Original file line number Diff line number Diff line change 1
1
@directive ("use client" )
2
-
3
2
let langShortname = (lang : string ) =>
4
3
switch lang {
5
4
| "ocaml" => "ml"
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ let makeCategories: string => array<Sidebar.Category.t> = version => [
5
5
name : "Overview" ,
6
6
items : [
7
7
{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` },
9
9
],
10
10
},
11
11
{
Original file line number Diff line number Diff line change @@ -133,15 +133,14 @@ module Sidebar = {
133
133
None
134
134
}
135
135
136
- let { pathname } = Next .Router .useRouter ()
136
+ let {pathname } = Next .Router .useRouter ()
137
137
138
- <>
138
+ <>
139
139
<div
140
140
id = "sidebar"
141
141
className = {(
142
142
isOpen ? "fixed w-full left-0 h-full z-20 min-w-320" : "hidden "
143
143
) ++ " 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
-
145
144
<aside
146
145
id = "sidebar-content"
147
146
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 = {
154
153
<Icon .Close />
155
154
</button >
156
155
<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 >
159
164
</div >
160
165
<div className = "flex justify-between" >
161
166
<div className = "w-3/4 md:w-full" > toplevelNav </div >
You can’t perform that action at this time.
0 commit comments