fix(docs): fix docs sidebar

This commit is contained in:
Waleed Latif
2025-05-20 10:03:19 -07:00
parent 1ebcaf5bfd
commit 6f8f307a5d
3 changed files with 51 additions and 44 deletions

View File

@@ -1,46 +1,5 @@
import type { ReactNode } from 'react'
import Link from 'next/link'
import { DocsLayout } from 'fumadocs-ui/layouts/docs'
import { ExternalLink, GithubIcon } from 'lucide-react'
import { source } from '@/lib/source'
const GitHubLink = () => (
<div className="fixed bottom-4 right-4 z-50">
<Link
href="https://github.com/simstudioai/sim"
target="_blank"
rel="noopener noreferrer"
className="flex items-center justify-center w-8 h-8 rounded-full bg-background border border-border hover:bg-muted transition-colors"
>
<GithubIcon className="h-4 w-4" />
</Link>
</div>
)
export default function Layout({ children }: { children: ReactNode }) {
return (
<>
<DocsLayout
tree={source.pageTree}
nav={{
title: <div className="flex items-center font-medium">Sim Studio</div>,
}}
links={[
{
text: 'Visit Sim Studio',
url: 'https://simstudio.ai',
icon: <ExternalLink className="h-4 w-4" />,
},
]}
sidebar={{
defaultOpenLevel: 1,
collapsible: true,
footer: null,
}}
>
{children}
</DocsLayout>
<GitHubLink />
</>
)
export default function SlugLayout({ children }: { children: ReactNode }) {
return children
}

View File

@@ -0,0 +1,46 @@
import type { ReactNode } from 'react'
import Link from 'next/link'
import { DocsLayout } from 'fumadocs-ui/layouts/docs'
import { ExternalLink, GithubIcon } from 'lucide-react'
import { source } from '@/lib/source'
const GitHubLink = () => (
<div className="fixed bottom-4 right-4 z-50">
<Link
href="https://github.com/simstudioai/sim"
target="_blank"
rel="noopener noreferrer"
className="flex items-center justify-center w-8 h-8 rounded-full bg-background border border-border hover:bg-muted transition-colors"
>
<GithubIcon className="h-4 w-4" />
</Link>
</div>
)
export default function Layout({ children }: { children: ReactNode }) {
return (
<>
<DocsLayout
tree={source.pageTree}
nav={{
title: <div className="flex items-center font-medium">Sim Studio</div>,
}}
links={[
{
text: 'Visit Sim Studio',
url: 'https://simstudio.ai',
icon: <ExternalLink className="h-4 w-4" />,
},
]}
sidebar={{
defaultOpenLevel: 1,
collapsible: true,
footer: null,
}}
>
{children}
</DocsLayout>
<GitHubLink />
</>
)
}

View File

@@ -161,7 +161,7 @@
},
"packages/simstudio": {
"name": "simstudio",
"version": "0.1.16",
"version": "0.1.17",
"bin": {
"simstudio": "dist/index.js",
},
@@ -3228,6 +3228,8 @@
"fast-glob/glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="],
"fdir/picomatch": ["picomatch@4.0.2", "", {}, "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg=="],
"form-data/mime-types": ["mime-types@2.1.35", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="],
"fumadocs-mdx/chokidar": ["chokidar@4.0.3", "", { "dependencies": { "readdirp": "^4.0.1" } }, "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA=="],