File tree Expand file tree Collapse file tree 3 files changed +8
-9
lines changed
Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -84,10 +84,6 @@ let blogPosts = async () => {
8484let manualTableOfContents = async () => {
8585 let groups =
8686 (await allMdx ())
87- -> Array .map (item => {
88- Console .log (item .path )
89- item
90- })
9187 -> filterMdxPages ("docs/manual" )
9288 -> groupBySection
9389 -> Dict .mapValues (values => values -> sortSection -> convertToNavItems ("/docs/manual" ))
@@ -285,8 +281,6 @@ let default = () => {
285281
286282 let {entries , categories , title } = loaderData
287283
288- Console .log2 ("Rendering MdxRoute for path:" , attributes )
289-
290284 <>
291285 {if (pathname :> string ) == "/docs/manual/api" {
292286 <>
Original file line number Diff line number Diff line change 22let make = (~children , ~categories , ~entries ) => {
33 let {pathname } = ReactRouter .useLocation ()
44
5- Console .log ((pathname :> string )-> String .split ("/" ))
6-
75 let activePage =
86 (pathname :> string )
97 -> String .split ("/" )
Original file line number Diff line number Diff line change @@ -10,6 +10,11 @@ let scrollToAnchor = (hash: string) => {
1010 WebAPI .Document .getElementById (document , hash )-> WebAPI .Element .scrollIntoView_alignToTop
1111}
1212
13+ let isDocRoute = (~route : Path .t ) => {
14+ let route = (route :> string )
15+ route -> String .includes ("/docs/" ) || route -> String .includes ("/syntax-lookup" )
16+ }
17+
1318module Toc = {
1419 type raw = Dict .t <{
1520 "title" : string ,
@@ -334,7 +339,9 @@ let make = (
334339 //width of the right content part
335340 <div
336341 id = "mobile-navbar"
337- className = {"z-10 fixed border-b shadow top-[112px] left-0 pl-4 bg-white w-full py-4 md:relative md:border-none md:shadow-none md:p-0 md:top-auto flex items-center transition duration-300 ease-out group-[.nav-disappear]:-translate-y-64 md:group-[.nav-disappear]:-translate-y-0" }
342+ className = {` z-10 fixed border-b shadow ${isDocRoute(~route= pathname)
343+ ? "top-[112px]"
344+ : "top-[64px]" } left-0 pl-4 bg-white w-full py-4 md:relative md:border-none md:shadow-none md:p-0 md:top-auto flex items-center transition duration-300 ease-out group-[.nav-disappear]:-translate-y-64 md:group-[.nav-disappear]:-translate-y-0` }
338345 >
339346 <MobileDrawerButton hidden = isNavOpen onClick = {handleDrawerButtonClick } />
340347 <div
You can’t perform that action at this time.
0 commit comments