Skip to content

Commit d229b3f

Browse files
committed
fix: use existing function instead
1 parent 0729991 commit d229b3f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/layouts/Docs.tsx

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

@@ -36,6 +34,7 @@ import YouTube from "@/components/YouTube"
3634

3735
import { cn } from "@/lib/utils/cn"
3836
import { getEditPath } from "@/lib/utils/editPath"
37+
import { addSlashes } from "@/lib/utils/url"
3938

4039
const baseHeadingClasses = "font-bold scroll-mt-40 break-words"
4140

@@ -122,7 +121,6 @@ export const DocsLayout = ({
122121
}: DocsLayoutProps) => {
123122
const isPageIncomplete = !!frontmatter.incomplete
124123
const absoluteEditPath = getEditPath(slug)
125-
const slugWithSlashes = join("/", slug, "/")
126124

127125
return (
128126
<div className="flex w-full flex-col border-b">
@@ -136,7 +134,7 @@ export const DocsLayout = ({
136134
className="flex justify-between bg-background-highlight lg:pe-8"
137135
dir={contentNotTranslated ? "ltr" : "unset"}
138136
>
139-
<SideNav path={slugWithSlashes} />
137+
<SideNav path={addSlashes(slug)} />
140138
<MainArticle className="min-w-0 flex-1 px-8 pb-8 pt-8 md:px-16 md:pb-16 md:pt-12">
141139
<H1 id="top">{frontmatter.title}</H1>
142140
<FileContributors

0 commit comments

Comments
 (0)