Repository navigation
feat(repo): add Mosaic docs site #10862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
74 commits
Select commit
Hold shift + click to select a range
7baf9e0
feat(repo): scaffold Mosaic docs site
alexcarpenter d0ca60b
feat(repo): add Mosaic docs site header, landing page and docs layout
alexcarpenter 42ff4a7
feat(repo): port Blume layout, sidebar, table of contents and footer …
alexcarpenter f5e7cc9
feat(repo): render Mosaic component, primitive and hook pages from do…
alexcarpenter 42fe3c9
feat(repo): match Blume prose styles on Mosaic docs site
alexcarpenter 8757417
feat(repo): serve Markdown versions of Mosaic docs pages
alexcarpenter 23b16cd
feat(repo): generate llms.txt and llms-full.txt for Mosaic docs site
alexcarpenter fddd893
feat(repo): highlight Mosaic docs code blocks with Shiki on the server
alexcarpenter ba00af2
feat(repo): add header, language icon and line numbers to Mosaic docs…
alexcarpenter f41a237
feat(repo): add Copy Markdown page action to Mosaic docs
alexcarpenter c2d0e7a
feat(repo): add copy button to Mosaic docs install command
alexcarpenter f857e75
feat(repo): add mobile navigation drawer to Mosaic docs
alexcarpenter 9b38edf
fix(repo): wrap long Mosaic docs footer links on narrow screens
alexcarpenter 8a7ce41
feat(repo): trim Mosaic docs landing footer to docs and resource links
alexcarpenter 284b648
fix(repo): close Mosaic docs sidebar link gaps and thin its scrollbars
alexcarpenter 85fe891
fix(repo): restore visual gap between Mosaic docs sidebar links
alexcarpenter 6bf0626
refactor(repo): fill Mosaic docs sidebar link gaps with a pseudo-elem…
alexcarpenter 65cc9ba
feat(repo): add live component previews to Mosaic docs
alexcarpenter a4a53bb
refactor(repo): bound Mosaic docs prose styles with @scope instead of…
alexcarpenter 2eed50d
feat(repo): adopt dashboard code colors and follow system dark mode i…
alexcarpenter 9a077ab
fix(repo): match Mosaic docs code block background to the page in dar…
alexcarpenter 5098d43
chore(repo): build Mosaic before starting the Mosaic docs dev server
alexcarpenter 4292d72
feat(repo): serve Mosaic docs pages as Markdown when the client prefe…
alexcarpenter 00211ae
chore(repo): tidy Mosaic docs landing hero
alexcarpenter 3e928b5
feat(repo): mark every visible section in the Mosaic docs table of co…
alexcarpenter 83e315b
docs(repo): add Mosaic docs README with acknowledgements
alexcarpenter fc504cb
feat(repo): author the Mosaic docs landing page in MDX
alexcarpenter 5fa22e2
feat(repo): self-host Inter as the Mosaic docs sans font
alexcarpenter 815b772
fix(repo): use typographic apostrophes in Mosaic docs copy
alexcarpenter fe1993b
fix(repo): keep a backslash before a pipe inside Mosaic docs Markdown…
alexcarpenter 1630f36
refactor(repo): split the Mosaic docs site into core, ui and next layers
alexcarpenter 3da690d
fix(repo): even out the spacing around the Mosaic docs sidebar divider
alexcarpenter d7ee0f7
feat(repo): show a collapsible on-this-page outline above Mosaic docs…
alexcarpenter ff15514
feat(repo): keep the Mosaic docs homepage footer bar below the fold s…
alexcarpenter 9e41667
refactor(repo): use canonical Tailwind classes in the Mosaic docs site
alexcarpenter a89671d
feat(repo): replace the Mosaic docs introduction with a setup guide t…
alexcarpenter 4a3d334
feat(repo): use the Clerk docs syntax colors in Mosaic docs code blocks
alexcarpenter f3bdabc
fix(repo): hide the Returns section on Mosaic docs hook pages with no…
alexcarpenter acf6076
feat(repo): keep Mosaic docs code line numbers sticky with edge fades…
alexcarpenter b1185cc
feat(repo): show the Clerk logo next to Mosaic in the docs site header
alexcarpenter b97f859
feat(repo): leave Captcha out of the Mosaic docs site
alexcarpenter d412bbb
feat(repo): file Mosaic hook docs under Hooks wherever their source f…
alexcarpenter 5c1540f
feat(repo): leave the internal useMosaic hooks out of the Mosaic docs…
alexcarpenter 7e682f2
feat(repo): color the install command on the Mosaic docs landing page
alexcarpenter 2134682
feat(repo): give the Mosaic docs code block copy button even spacing
alexcarpenter ba7582d
feat(repo): show Mosaic docs practices as a table with Do and Don't b…
alexcarpenter 45dd24f
feat(repo): serve the Mosaic docs Setup page at /docs/setup
alexcarpenter edcbd25
feat(repo): replace the Mosaic docs install command with an agent prompt
alexcarpenter bec9f10
feat(repo): invert the Cursor logo in dark mode and drop the Mosaic d…
alexcarpenter 03761e4
chore(repo): dedupe pnpm lockfile
alexcarpenter d264459
fix(repo): accept Windows paths when generating the Mosaic docs
alexcarpenter 7e107bd
fix(repo): add the skip link target to the Mosaic docs landing page
alexcarpenter c302d8b
fix(repo): link Mosaic docs footer categories to their first page
alexcarpenter 80b6000
fix(repo): include the Setup page in the Mosaic docs llms-full.txt
alexcarpenter a20c9ac
fix(repo): show a failure state when Mosaic docs copy buttons cannot …
alexcarpenter c928475
refactor(repo): derive Mosaic doc headings, Markdown and HTML from on…
alexcarpenter cd4490f
refactor(repo): place Mosaic docs and reject duplicates on their fina…
alexcarpenter d637ffe
refactor(repo): share one page shell across the Mosaic docs pages
alexcarpenter c7dd00d
docs(repo): leave ActionMenu, Branding and ClerkLogo out of the Mosai…
alexcarpenter f5d85e3
fix(repo): link related Mosaic docs that name a part
alexcarpenter 6485bfc
chore(repo): keep the Mosaic docs site out of search results
alexcarpenter ed39fbc
fix(repo): use absolute URLs in the Mosaic docs llms files
alexcarpenter 0507e65
docs(repo): list Setup first in the Mosaic docs llms.txt
alexcarpenter 4937f5f
docs(repo): describe Mosaic as Clerk's design system
alexcarpenter beb8f96
docs(repo): tidy the Mosaic setup wording
alexcarpenter cc45078
feat(repo): link to clerk.com/docs from a banner on the Mosaic docs
alexcarpenter 6ea57a6
docs(repo): leave ScrollArea out of the Mosaic docs
alexcarpenter ff008e2
fix(repo): stop clipping the focus ring on the Mosaic docs banner link
alexcarpenter 1f13a15
docs(repo): bring ActionMenu back to the Mosaic docs
alexcarpenter 4048dab
fix(repo): mark every Mosaic docs response noindex
alexcarpenter aba1c49
docs(repo): point Mosaic llms.txt readers to clerk.com/docs
alexcarpenter e70187a
docs(repo): leave hooks out of the Mosaic docs for now
alexcarpenter 28e8fbb
docs(repo): note that Mosaic can break in minor releases
alexcarpenter 1ec2a07
docs(repo): put Mosaic's layer after Tailwind's base reset (#10896)
maxyinger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| --- | ||
| --- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| src/generated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <!-- BEGIN:nextjs-agent-rules --> | ||
|
|
||
| ## This is NOT the Next.js you know | ||
|
|
||
| This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices. | ||
|
|
||
| This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean. | ||
|
|
||
| <!-- END:nextjs-agent-rules --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Mosaic docs | ||
|
|
||
| The documentation site for [`@clerk/mosaic`](../mosaic), Clerk's design system. | ||
|
|
||
| ## Development | ||
|
|
||
| From the repository root: | ||
|
|
||
| ```sh | ||
| pnpm dev:mosaic-docs | ||
| ``` | ||
|
|
||
| This builds `@clerk/mosaic` and starts the site at http://localhost:6021. | ||
|
|
||
| ## Layout | ||
|
|
||
| The site is split into layers so the docs system can be reused. `src/layers.test.ts` enforces the import rules. | ||
|
|
||
| | Folder | Contains | May import | | ||
| | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ------------- | | ||
| | `src/core` | Pure functions and the doc schema: Markdown output, llms.txt, content negotiation, highlighting, the TOC and the remark headings plugin | packages only | | ||
| | `src/ui` | React parts and `styles.css` | `src/core` | | ||
| | `src/next` | Next.js adapters, such as `markdownProxy` | `src/core` | | ||
| | everything else | Mosaic-specific content, data, examples and pages | anything | | ||
|
|
||
| ## Acknowledgements | ||
|
|
||
| The site's design and features were inspired by [Blume](https://github.com/haydenbleasel/blume) and [Fumadocs](https://github.com/fuma-nama/fumadocs). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import { fileURLToPath } from 'node:url'; | ||
|
|
||
| import createMDX from '@next/mdx'; | ||
|
|
||
| /** @type {import('next').NextConfig} */ | ||
| const nextConfig = { | ||
| pageExtensions: ['ts', 'tsx', 'mdx'], | ||
| headers() { | ||
| return [{ source: '/:path*', headers: [{ key: 'X-Robots-Tag', value: 'noindex' }] }]; | ||
| }, | ||
| redirects() { | ||
| return [ | ||
| { source: '/docs', destination: '/docs/setup', permanent: true }, | ||
| { source: '/docs.md', destination: '/docs/setup.md', permanent: true }, | ||
| ]; | ||
| }, | ||
| rewrites() { | ||
| return [{ source: '/docs/:path*.md', destination: '/llms.mdx/docs/:path*' }]; | ||
| }, | ||
| }; | ||
|
|
||
| const withMDX = createMDX({ | ||
| options: { | ||
| remarkPlugins: [fileURLToPath(new URL('./src/core/remark-headings.ts', import.meta.url))], | ||
| }, | ||
| }); | ||
|
|
||
| export default withMDX(nextConfig); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| { | ||
| "name": "@clerk/mosaic-docs", | ||
| "version": "0.0.0", | ||
| "private": true, | ||
| "type": "module", | ||
| "scripts": { | ||
| "build": "pnpm generate && next build", | ||
| "dev": "pnpm generate && next dev --port 6021", | ||
| "format": "node ../../scripts/format-package.mjs", | ||
| "format:check": "node ../../scripts/format-package.mjs --check", | ||
| "generate": "node scripts/generate-docs.mjs", | ||
| "lint": "oxlint -c ../../oxlint.config.mjs src scripts", | ||
| "test": "node --test 'scripts/*.test.mjs' 'src/**/*.test.ts'", | ||
| "typecheck": "pnpm generate && next typegen && tsc --noEmit" | ||
| }, | ||
| "dependencies": { | ||
| "@clerk/mosaic": "workspace:*", | ||
| "@mdx-js/loader": "^3.1.1", | ||
| "@mdx-js/react": "^3.1.1", | ||
| "@next/mdx": "^16.4.3", | ||
| "estree-util-value-to-estree": "^3.5.0", | ||
| "github-slugger": "^2.0.0", | ||
| "mdast-util-to-string": "^4.0.0", | ||
| "next": "^16.4.3", | ||
| "react": "catalog:react", | ||
| "react-dom": "catalog:react", | ||
| "shiki": "^4.1.0", | ||
| "unist-util-visit": "^5.2.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@mdx-js/mdx": "^3.1.1", | ||
| "@tailwindcss/postcss": "^4.3.0", | ||
| "@tailwindcss/typography": "^0.5.20", | ||
| "@types/mdast": "^4.0.4", | ||
| "@types/mdx": "^2.0.14", | ||
| "@types/react": "catalog:react", | ||
| "@types/react-dom": "catalog:react", | ||
| "tailwindcss": "^4.3.0", | ||
| "typescript": "catalog:repo" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| export default { | ||
| plugins: { | ||
| '@tailwindcss/postcss': {}, | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| import { globSync, mkdirSync, realpathSync, writeFileSync } from 'node:fs'; | ||
| import { dirname, relative } from 'node:path'; | ||
| import { fileURLToPath } from 'node:url'; | ||
|
|
||
| const DOC_PATH = /^src\/(?:(components|primitives)\/([a-z0-9-]+)\/\2|(hooks)\/(use-[a-z0-9-]+))\.doc\.ts$/; | ||
| const EXCLUDED = new Set([ | ||
| 'components/branding', | ||
| 'components/captcha', | ||
| 'components/clerk-logo', | ||
| 'components/scroll-area', | ||
| 'hooks/use-mosaic-environment', | ||
| 'hooks/use-mosaic-experimental', | ||
| 'hooks/use-mosaic-router', | ||
| 'hooks/use-mosaic-support-email', | ||
| ]); | ||
|
|
||
| export function toEntries(paths) { | ||
| const entries = paths.map(toPosix).map(path => { | ||
| const match = DOC_PATH.exec(path); | ||
| if (!match) { | ||
| throw new Error(`Unexpected doc location: ${path}`); | ||
| } | ||
| const kind = match[1] ?? match[3]; | ||
| const slug = match[2] ?? match[4]; | ||
| return { kind, slug, path: path.replace(/\.ts$/, '') }; | ||
| }); | ||
|
|
||
| return entries | ||
| .filter(({ kind, slug }) => !EXCLUDED.has(`${kind}/${slug}`)) | ||
| .sort((a, b) => a.kind.localeCompare(b.kind) || a.slug.localeCompare(b.slug)); | ||
| } | ||
|
|
||
| export function renderModule(dir, entries) { | ||
| const mosaicDir = toPosix(dir); | ||
| const imports = entries.map((entry, index) => `import doc${index} from '${mosaicDir}/${entry.path}';`); | ||
| const rows = entries.map((entry, index) => ` { kind: '${entry.kind}', slug: '${entry.slug}', doc: doc${index} },`); | ||
| return [ | ||
| `import type { ComponentDoc, HookDoc } from '${mosaicDir}/src/docs-schema';`, | ||
| ...imports, | ||
| '', | ||
| 'type Props = Record<string, unknown>;', | ||
| '', | ||
| 'export interface DocEntry {', | ||
| " kind: 'components' | 'primitives' | 'hooks';", | ||
| ' slug: string;', | ||
| ' doc: ComponentDoc<Record<string, Props>> | HookDoc<Props, Props>;', | ||
| '}', | ||
| '', | ||
| 'export const docEntries: DocEntry[] = [', | ||
| ...rows, | ||
| '];', | ||
| '', | ||
| ].join('\n'); | ||
| } | ||
|
|
||
| function toPosix(path) { | ||
| return path.replaceAll('\\', '/'); | ||
| } | ||
|
|
||
| if (import.meta.main) { | ||
| const mosaicDir = realpathSync(dirname(fileURLToPath(import.meta.resolve('@clerk/mosaic/package.json')))); | ||
| const outFile = fileURLToPath(new URL('../src/generated/docs.ts', import.meta.url)); | ||
| const entries = toEntries(globSync('src/{components,primitives,hooks}/**/*.doc.ts', { cwd: mosaicDir })); | ||
| mkdirSync(dirname(outFile), { recursive: true }); | ||
| writeFileSync(outFile, renderModule(relative(dirname(outFile), mosaicDir), entries)); | ||
| console.log(`Generated ${entries.length} docs`); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| import assert from 'node:assert/strict'; | ||
| import { test } from 'node:test'; | ||
|
|
||
| import { renderModule, toEntries } from './generate-docs.mjs'; | ||
|
|
||
| test('maps doc paths to a kind and slug', () => { | ||
| assert.deepEqual( | ||
| toEntries([ | ||
| 'src/primitives/accordion/accordion.doc.ts', | ||
| 'src/hooks/use-pending-action.doc.ts', | ||
| 'src/components/button/button.doc.ts', | ||
| ]), | ||
| [ | ||
| { kind: 'components', slug: 'button', path: 'src/components/button/button.doc' }, | ||
| { kind: 'hooks', slug: 'use-pending-action', path: 'src/hooks/use-pending-action.doc' }, | ||
| { kind: 'primitives', slug: 'accordion', path: 'src/primitives/accordion/accordion.doc' }, | ||
| ], | ||
| ); | ||
| }); | ||
|
|
||
| test('leaves out docs the site does not publish', () => { | ||
| assert.deepEqual(toEntries(['src/components/captcha/captcha.doc.ts', 'src/components/button/button.doc.ts']), [ | ||
| { kind: 'components', slug: 'button', path: 'src/components/button/button.doc' }, | ||
| ]); | ||
| }); | ||
|
|
||
| test('rejects a doc outside the documented locations', () => { | ||
| assert.throws( | ||
| () => toEntries(['src/components/button/parts/icon.doc.ts']), | ||
| /src\/components\/button\/parts\/icon\.doc\.ts/, | ||
| ); | ||
| assert.throws(() => toEntries(['src/blocks/sign-in/sign-in.doc.ts']), /sign-in\.doc\.ts/); | ||
| }); | ||
|
|
||
| test('renders one typed import per doc', () => { | ||
| const source = renderModule('../../../mosaic', [ | ||
| { kind: 'components', slug: 'button', path: 'src/components/button/button.doc' }, | ||
| { kind: 'hooks', slug: 'use-form', path: 'src/hooks/use-form.doc' }, | ||
| ]); | ||
| assert.match(source, /import type \{ ComponentDoc, HookDoc \} from '\.\.\/\.\.\/\.\.\/mosaic\/src\/docs-schema';/); | ||
| assert.match(source, /import doc0 from '\.\.\/\.\.\/\.\.\/mosaic\/src\/components\/button\/button\.doc';/); | ||
| assert.match(source, /import doc1 from '\.\.\/\.\.\/\.\.\/mosaic\/src\/hooks\/use-form\.doc';/); | ||
| assert.match(source, /\{ kind: 'components', slug: 'button', doc: doc0 \}/); | ||
| assert.match(source, /\{ kind: 'hooks', slug: 'use-form', doc: doc1 \}/); | ||
| }); | ||
|
|
||
| test('accepts Windows doc paths', () => { | ||
| assert.deepEqual(toEntries(['src\\components\\button\\button.doc.ts']), [ | ||
| { kind: 'components', slug: 'button', path: 'src/components/button/button.doc' }, | ||
| ]); | ||
| }); | ||
|
|
||
| test('renders forward-slash imports from a Windows Mosaic directory', () => { | ||
| const source = renderModule('..\\..\\mosaic', [ | ||
| { kind: 'components', slug: 'button', path: 'src/components/button/button.doc' }, | ||
| ]); | ||
| assert.match(source, /from '\.\.\/\.\.\/mosaic\/src\/docs-schema';/); | ||
| assert.match(source, /import doc0 from '\.\.\/\.\.\/mosaic\/src\/components\/button\/button\.doc';/); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import type { Metadata } from 'next'; | ||
| import { notFound } from 'next/navigation'; | ||
|
|
||
| import { Preview } from '@/components/preview'; | ||
| import { docHeadings } from '@/core/doc-sections'; | ||
| import { docEntries, docHref, findDoc, relatedHref } from '@/lib/docs'; | ||
| import { DocContent } from '@/ui/doc-content'; | ||
| import { DocsPage } from '@/ui/docs-page'; | ||
|
|
||
| export const dynamicParams = false; | ||
|
|
||
| export function generateStaticParams(): { kind: string; slug: string }[] { | ||
| return docEntries.map(({ kind, slug }) => ({ kind, slug })); | ||
| } | ||
|
|
||
| export async function generateMetadata({ params }: PageProps<'/docs/[kind]/[slug]'>): Promise<Metadata> { | ||
| const { kind, slug } = await params; | ||
| const entry = findDoc(kind, slug); | ||
| return entry | ||
| ? { | ||
| title: entry.doc.name, | ||
| description: entry.doc.description, | ||
| alternates: { types: { 'text/markdown': `${docHref(entry)}.md` } }, | ||
| } | ||
| : {}; | ||
| } | ||
|
|
||
| export default async function DocPage({ params }: PageProps<'/docs/[kind]/[slug]'>) { | ||
| const { kind, slug } = await params; | ||
| const entry = findDoc(kind, slug); | ||
| if (!entry) { | ||
| notFound(); | ||
| } | ||
|
|
||
| return ( | ||
| <DocsPage | ||
| headings={docHeadings(entry.doc)} | ||
| markdownHref={`${docHref(entry)}.md`} | ||
| > | ||
| <DocContent | ||
| doc={entry.doc} | ||
| preview={<Preview path={`${kind}/${slug}`} />} | ||
| hrefFor={relatedHref} | ||
| /> | ||
| </DocsPage> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import type { ReactNode } from 'react'; | ||
|
|
||
| import { SiteFooter } from '@/components/site-footer'; | ||
| import { navigation } from '@/lib/navigation'; | ||
| import { DocsNav } from '@/ui/docs-nav'; | ||
|
|
||
| export default function DocsLayout({ children }: { children: ReactNode }) { | ||
| return ( | ||
| <> | ||
| <div className='mx-auto grid w-full flex-1 grid-cols-1 items-start lg:grid-cols-[17.5rem_minmax(0,1fr)] xl:grid-cols-[17.5rem_minmax(0,1fr)_17.5rem]'> | ||
| <aside | ||
| aria-label='Docs' | ||
| className='scrollbar-thin scrollbar-thumb-border scrollbar-track-transparent sticky top-16 hidden max-h-[calc(100dvh-4rem)] overflow-y-auto px-4 pb-6 pt-4 lg:block' | ||
| > | ||
| <nav> | ||
| <DocsNav groups={navigation} /> | ||
| </nav> | ||
| </aside> | ||
| {children} | ||
| </div> | ||
| <SiteFooter /> | ||
| </> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import Setup, { headings as setupHeadings } from '@/content/setup.mdx'; | ||
| import { DocsPage } from '@/ui/docs-page'; | ||
|
|
||
| export const metadata = { | ||
| title: 'Setup', | ||
| alternates: { types: { 'text/markdown': '/docs/setup.md' } }, | ||
| }; | ||
|
|
||
| export default function Layout({ children }) { | ||
| return ( | ||
| <DocsPage | ||
| headings={setupHeadings} | ||
| markdownHref='/docs/setup.md' | ||
| > | ||
| {children} | ||
| </DocsPage> | ||
| ); | ||
| } | ||
|
|
||
| <Setup /> |
Binary file not shown.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.