Skip to content

Commit 0729991

Browse files
committed
fix: correct the path used for SideNav
1 parent e2553a5 commit 0729991

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/layouts/Docs.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { join } from "path"
2+
13
import { MDXRemoteProps } from "next-mdx-remote"
24
import type { HTMLAttributes } from "react"
35

@@ -120,6 +122,7 @@ export const DocsLayout = ({
120122
}: DocsLayoutProps) => {
121123
const isPageIncomplete = !!frontmatter.incomplete
122124
const absoluteEditPath = getEditPath(slug)
125+
const slugWithSlashes = join("/", slug, "/")
123126

124127
return (
125128
<div className="flex w-full flex-col border-b">
@@ -133,7 +136,7 @@ export const DocsLayout = ({
133136
className="flex justify-between bg-background-highlight lg:pe-8"
134137
dir={contentNotTranslated ? "ltr" : "unset"}
135138
>
136-
<SideNav path={slug} />
139+
<SideNav path={slugWithSlashes} />
137140
<MainArticle className="min-w-0 flex-1 px-8 pb-8 pt-8 md:px-16 md:pb-16 md:pt-12">
138141
<H1 id="top">{frontmatter.title}</H1>
139142
<FileContributors

0 commit comments

Comments
 (0)