|
1 | 1 | import { getDocumentationContent } from '@/lib/docs'; |
2 | 2 | import ReactMarkdown from 'react-markdown'; |
3 | 3 | import rehypeHighlight from 'rehype-highlight'; |
| 4 | +import remarkGfm from 'remark-gfm'; |
4 | 5 | import { Title, Meta } from 'react-meta-seo'; |
5 | 6 | import Link from 'next/link'; |
6 | | -import { ArrowLeft } from 'lucide-react'; |
| 7 | +import { ArrowLeft, BookOpen, ChevronRight, Home } from 'lucide-react'; |
| 8 | +import rehypeSlug from 'rehype-slug'; |
| 9 | +import rehypeAutolinkHeadings from 'rehype-autolink-headings'; |
7 | 10 |
|
8 | 11 | export default async function DocsPage() { |
9 | 12 | const content = getDocumentationContent(); |
10 | 13 |
|
11 | 14 | return ( |
12 | | - <div className="min-h-screen bg-neutral-950 text-neutral-50 selection:bg-blue-500/30"> |
| 15 | + <div className="min-h-screen bg-[#0A0A0A] text-neutral-200 selection:bg-blue-500/30"> |
13 | 16 | <Title>Documentation | react-meta-seo</Title> |
14 | 17 | <Meta name="description" content="Comprehensive documentation for react-meta-seo. Integration guides, API reference, and migration tutorials." /> |
15 | 18 |
|
16 | | - <header className="sticky top-0 z-50 border-b border-white/10 bg-neutral-950/80 backdrop-blur-md"> |
17 | | - <div className="mx-auto flex h-16 max-w-4xl items-center justify-between px-6"> |
18 | | - <Link href="/" className="flex items-center gap-2 text-sm font-medium text-neutral-400 hover:text-white transition-colors"> |
19 | | - <ArrowLeft className="h-4 w-4" /> |
20 | | - Back to Home |
21 | | - </Link> |
22 | | - <div className="font-semibold">Documentation</div> |
| 19 | + {/* Blur Backend */} |
| 20 | + <div className="fixed inset-0 -z-10 bg-[radial-gradient(ellipse_at_top,_var(--tw-gradient-stops))] from-blue-900/10 via-[#0A0A0A] to-[#0A0A0A]" /> |
| 21 | + |
| 22 | + {/* Header */} |
| 23 | + <header className="sticky top-0 z-50 border-b border-white/5 bg-[#0A0A0A]/80 backdrop-blur-xl"> |
| 24 | + <div className="mx-auto flex h-16 max-w-7xl items-center justify-between px-6"> |
| 25 | + <div className="flex items-center gap-4"> |
| 26 | + <Link href="/" className="group flex items-center gap-2 text-sm font-medium text-neutral-400 hover:text-white transition-colors"> |
| 27 | + <div className="flex h-8 w-8 items-center justify-center rounded-lg border border-white/5 bg-white/5 transition-colors group-hover:bg-white/10 group-hover:border-white/10"> |
| 28 | + <ArrowLeft className="h-4 w-4" /> |
| 29 | + </div> |
| 30 | + <span className="hidden sm:inline">Back to Home</span> |
| 31 | + </Link> |
| 32 | + <div className="h-4 w-px bg-white/10 hidden sm:block" /> |
| 33 | + <nav className="flex items-center gap-2 text-sm text-neutral-400"> |
| 34 | + <Home className="h-4 w-4" /> |
| 35 | + <ChevronRight className="h-4 w-4 text-neutral-600" /> |
| 36 | + <span className="text-white font-medium">Documentation</span> |
| 37 | + </nav> |
| 38 | + </div> |
23 | 39 | </div> |
24 | 40 | </header> |
25 | 41 |
|
26 | | - <div className="mx-auto max-w-4xl px-6 py-12"> |
27 | | - <article className="prose prose-invert prose-blue max-w-none prose-headings:scroll-mt-24 prose-pre:bg-neutral-900 prose-pre:border prose-pre:border-white/10"> |
28 | | - <ReactMarkdown rehypePlugins={[rehypeHighlight]}> |
29 | | - {content} |
30 | | - </ReactMarkdown> |
31 | | - </article> |
| 42 | + <div className="mx-auto max-w-7xl px-6 py-12 lg:py-16"> |
| 43 | + <div className="grid lg:grid-cols-[1fr_300px] gap-12"> |
| 44 | + |
| 45 | + {/* Main Content */} |
| 46 | + <main className="min-w-0"> |
| 47 | + <article className="prose prose-invert prose-blue max-w-none |
| 48 | + prose-headings:font-semibold prose-headings:tracking-tight prose-headings:text-white |
| 49 | + prose-h1:text-4xl prose-h1:mb-8 prose-h1:pb-4 prose-h1:border-b prose-h1:border-white/10 |
| 50 | + prose-h2:text-2xl prose-h2:mt-12 prose-h2:mb-6 |
| 51 | + prose-p:text-neutral-400 prose-p:leading-7 |
| 52 | + prose-a:text-blue-400 prose-a:no-underline hover:prose-a:text-blue-300 hover:prose-a:underline |
| 53 | + prose-code:text-blue-200 prose-code:bg-blue-500/10 prose-code:px-1.5 prose-code:py-0.5 prose-code:rounded-md prose-code:before:content-none prose-code:after:content-none |
| 54 | + prose-pre:bg-[#111] prose-pre:border prose-pre:border-white/5 prose-pre:rounded-xl |
| 55 | + prose-img:rounded-xl prose-img:border prose-img:border-white/10 |
| 56 | + prose-strong:text-white |
| 57 | + prose-ul:text-neutral-400 |
| 58 | + prose-table:border-collapse prose-th:text-left prose-th:p-4 prose-th:text-white prose-th:bg-white/5 prose-td:p-4 prose-td:text-neutral-400 prose-td:border-b prose-td:border-white/5 |
| 59 | + "> |
| 60 | + <ReactMarkdown |
| 61 | + remarkPlugins={[remarkGfm]} |
| 62 | + rehypePlugins={[rehypeHighlight, rehypeSlug, [rehypeAutolinkHeadings, { behavior: 'wrap' }]]} |
| 63 | + components={{ |
| 64 | + blockquote: ({ node, ...props }) => ( |
| 65 | + <blockquote className="not-italic border-l-4 border-blue-500/50 bg-blue-500/5 px-6 py-4 rounded-r-lg my-6 text-neutral-300" {...props} /> |
| 66 | + ), |
| 67 | + table: ({ node, ...props }) => ( |
| 68 | + <div className="overflow-x-auto my-8 rounded-lg border border-white/5"> |
| 69 | + <table className="w-full text-sm" {...props} /> |
| 70 | + </div> |
| 71 | + ), |
| 72 | + hr: ({ node, ...props }) => ( |
| 73 | + <hr className="my-12 border-white/5" {...props} /> |
| 74 | + ) |
| 75 | + }} |
| 76 | + > |
| 77 | + {content} |
| 78 | + </ReactMarkdown> |
| 79 | + </article> |
| 80 | + </main> |
| 81 | + |
| 82 | + {/* Sidebar (Desktop) */} |
| 83 | + <aside className="hidden lg:block space-y-8"> |
| 84 | + <div className="sticky top-24 space-y-6"> |
| 85 | + <div className="rounded-xl border border-white/5 bg-white/[0.02] p-6 backdrop-blur-sm"> |
| 86 | + <h3 className="flex items-center gap-2 font-semibold text-white mb-4"> |
| 87 | + <BookOpen className="h-4 w-4 text-blue-400" /> |
| 88 | + On this page |
| 89 | + </h3> |
| 90 | + <div className="text-sm text-neutral-500"> |
| 91 | + {/* Note: Real TOC parsing would happen here. For now static placeholder or we rely on the markdown's TOC */} |
| 92 | + <p className="text-xs uppercase tracking-wider font-medium text-neutral-600 mb-2">Structure</p> |
| 93 | + <ul className="space-y-2.5"> |
| 94 | + <li><a href="#introduction" className="hover:text-blue-400 transition-colors block">Introduction</a></li> |
| 95 | + <li><a href="#core-concepts" className="hover:text-blue-400 transition-colors block">Core Concepts</a></li> |
| 96 | + <li><a href="#api-reference" className="hover:text-blue-400 transition-colors block">API Reference</a></li> |
| 97 | + <li><a href="#advanced-seo" className="hover:text-blue-400 transition-colors block">Advanced SEO</a></li> |
| 98 | + <li><a href="#migration-guide" className="hover:text-blue-400 transition-colors block">Migration Guide</a></li> |
| 99 | + </ul> |
| 100 | + </div> |
| 101 | + </div> |
| 102 | + |
| 103 | + <div className="rounded-xl bg-gradient-to-br from-blue-600 to-violet-600 p-6 text-white shadow-2xl shadow-blue-900/20"> |
| 104 | + <h3 className="font-bold text-lg mb-2">Ready to ship?</h3> |
| 105 | + <p className="text-blue-100 text-sm mb-4">Get the best SEO performance for your React 19 app today.</p> |
| 106 | + <div className="bg-white/10 rounded-lg p-2 font-mono text-xs flex items-center justify-between cursor-pointer hover:bg-white/20 transition-colors"> |
| 107 | + <span>npm i react-meta-seo</span> |
| 108 | + </div> |
| 109 | + </div> |
| 110 | + </div> |
| 111 | + </aside> |
| 112 | + </div> |
32 | 113 | </div> |
33 | 114 | </div> |
34 | 115 | ); |
|
0 commit comments