Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./.next/dev/types/routes.d.ts";
import "./.next/types/routes.d.ts";

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
49 changes: 20 additions & 29 deletions src/app/docs/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,31 +73,28 @@ export default async function DocPage({ params }: PageProps) {
}

return (
<div className="flex min-h-screen">
<>
{/* Mobile Navigation Drawer */}
<MobileNav items={navRoots} />

{/* 3-Column Layout: Sidebar + Content + TOC */}
{/* Desktop (>1200px): 3 columns, Tablet (768-1200px): 2 columns, Mobile (<768px): 1 column */}
<div className="flex-1 grid grid-cols-1 lg:grid-cols-[280px_1fr] xl:grid-cols-[280px_1fr_240px] max-w-[1920px] mx-auto w-full" style={{ minHeight: 'calc(100vh - 64px)' }}>
<div className="docs-main-layout">
{/* Sidebar Navigation - Hidden on mobile */}
<Sidebar items={navRoots} />

{/* Main Content */}
<main className="content-area max-w-[900px] mx-auto lg:mx-0">
<main className="docs-content">
<Breadcrumbs items={breadcrumbs} />

<h1 className="text-[42px] font-bold tracking-[-0.02em] mb-4 text-[var(--text)]" style={{ lineHeight: '1.2' }}>
{frontmatter.title}
</h1>
<h1>{frontmatter.title}</h1>

{/* Reading Metadata */}
<div className="flex items-center gap-6 mb-8 pb-8 border-b border-[var(--border)] text-[14px] text-[var(--text-tertiary)]">
<div className="flex items-center gap-1.5">
<div className="docs-content-meta">
<div className="meta-item">
<span>📖</span>
<span>{readingTime} min read</span>
</div>
<div className="flex items-center gap-1.5">
<div className="meta-item">
<span>📅</span>
<span>
Last updated: {new Date(lastModified).toLocaleDateString('en-US', {
Expand All @@ -108,7 +105,7 @@ export default async function DocPage({ params }: PageProps) {
</span>
</div>
{frontmatter.author && (
<div className="flex items-center gap-1.5">
<div className="meta-item">
<span>👤</span>
<span>{frontmatter.author}</span>
</div>
Expand Down Expand Up @@ -141,18 +138,16 @@ export default async function DocPage({ params }: PageProps) {
},
// Skip markdown h1 to avoid duplicate with page title
h1: () => null,
h2: ({ node, ...props }: any) => <h2 id={getTitleSlug(props.children?.[0])} className="scroll-mt-20 text-[30px] font-bold mt-12 mb-4 text-[var(--text)]" {...props} />,
h3: ({ node, ...props }: any) => <h3 id={getTitleSlug(props.children?.[0])} className="scroll-mt-20 text-[24px] font-semibold text-[var(--text)]" style={{ marginTop: '32px', marginBottom: '12px' }} {...props} />,
h4: ({ node, ...props }: any) => <h4 id={getTitleSlug(props.children?.[0])} className="scroll-mt-20 text-xl font-semibold mt-6 mb-2 text-[var(--text)]" {...props} />,
h5: ({ node, ...props }: any) => <h5 id={getTitleSlug(props.children?.[0])} className="scroll-mt-20 text-lg font-semibold mt-4 mb-2 text-[var(--text)]" {...props} />,
h6: ({ node, ...props }: any) => <h6 id={getTitleSlug(props.children?.[0])} className="scroll-mt-20 text-base font-semibold mt-4 mb-2 text-[var(--text)]" {...props} />,
p: ({ node, ...props }: any) => <p className="mb-4 text-[var(--text-secondary)]" style={{ lineHeight: '1.7', fontWeight: 400 }} {...props} />,
ul: ({ node, ...props }: any) => <ul className="mb-4 text-[var(--text-secondary)]" style={{ paddingLeft: '24px' }} {...props} />,
ol: ({ node, ...props }: any) => <ol className="mb-4 text-[var(--text-secondary)]" style={{ paddingLeft: '24px' }} {...props} />,
li: ({ node, ...props }: any) => <li className="mb-2 text-[var(--text-secondary)]" {...props} />,
a: ({ node, ...props }: any) => (
<a className="text-[var(--purple)] hover:underline" {...props} />
),
h2: ({ node, ...props }: any) => <h2 id={getTitleSlug(props.children?.[0])} className="scroll-mt-20" {...props} />,
h3: ({ node, ...props }: any) => <h3 id={getTitleSlug(props.children?.[0])} className="scroll-mt-20" {...props} />,
h4: ({ node, ...props }: any) => <h4 id={getTitleSlug(props.children?.[0])} className="scroll-mt-20" {...props} />,
h5: ({ node, ...props }: any) => <h5 id={getTitleSlug(props.children?.[0])} className="scroll-mt-20" {...props} />,
h6: ({ node, ...props }: any) => <h6 id={getTitleSlug(props.children?.[0])} className="scroll-mt-20" {...props} />,
p: ({ node, ...props }: any) => <p {...props} />,
ul: ({ node, ...props }: any) => <ul {...props} />,
ol: ({ node, ...props }: any) => <ol {...props} />,
li: ({ node, ...props }: any) => <li {...props} />,
a: ({ node, ...props }: any) => <a {...props} />,
}}
>
{body}
Expand All @@ -165,13 +160,9 @@ export default async function DocPage({ params }: PageProps) {
</main>

{/* Table of Contents - Hidden below 1200px to match mockup */}
{toc.length > 0 && (
<aside className="hidden xl:block">
<TableOfContents toc={toc} />
</aside>
)}
{toc.length > 0 && <TableOfContents toc={toc} />}
</div>
</div>
</>
);
}

Expand Down
Loading
Loading