feat(docs): add a Diátaxis documentation section to the public site
A new public /docs area covering the whole platform, organized by Diátaxis: tutorials (learning), how-to guides (tasks), reference (facts), and explanation (the why). 29 pages, each grounded in the actual routes, actions, schema, and UI — verified against the code and corrected for accuracy (e.g. admin-only vs admin+board gating, where the permissions matrix actually lives, how Stripe reconciliation matches). Implementation: - lib/docs/nav.ts is the single source of truth (categories + pages), driving the sidebar, static params, and prev/next. - Content authored as content/docs/<category>/<slug>.md, read at build time (the routes are statically generated), rendered by <DocsMarkdown> — reuses the existing react-markdown/GFM stack, no new dependencies. - (docs) route group with its own theme (docs.css) matching the public site's dark / monospace / lime aesthetic; sidebar with active-state, breadcrumb, prev/next, and a Diátaxis home. Public — signed-in users can read it too. - "Docs" link added to the landing nav. typecheck 0 · lint 0 errors · build ok (all /docs pages prerendered)
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
import type { Metadata } from 'next'
|
||||
import Link from 'next/link'
|
||||
import { IBM_Plex_Mono, Libre_Baskerville } from 'next/font/google'
|
||||
import { BrandMark } from '@/components/brand-mark'
|
||||
import './docs.css'
|
||||
|
||||
const ibmPlexMono = IBM_Plex_Mono({
|
||||
subsets: ['latin'],
|
||||
weight: ['400', '500'],
|
||||
variable: '--font-ibm-plex-mono',
|
||||
display: 'swap',
|
||||
})
|
||||
|
||||
const libreBaskerville = Libre_Baskerville({
|
||||
subsets: ['latin'],
|
||||
weight: ['400', '700'],
|
||||
style: ['normal', 'italic'],
|
||||
variable: '--font-libre-baskerville',
|
||||
display: 'swap',
|
||||
})
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: {
|
||||
default: 'Docs — hackerspace.sh',
|
||||
template: '%s — hackerspace.sh docs',
|
||||
},
|
||||
description:
|
||||
'Documentation for hackerspace.sh: tutorials, how-to guides, reference, and explanation for running your space.',
|
||||
}
|
||||
|
||||
export default function DocsLayout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<div className={`docs-root ${ibmPlexMono.variable} ${libreBaskerville.variable}`}>
|
||||
<div className="docs-grid-bg" aria-hidden="true" />
|
||||
<header className="docs-header">
|
||||
<div className="docs-header-inner">
|
||||
<Link href="/docs" className="docs-wordmark" aria-label="hackerspace.sh docs">
|
||||
<BrandMark className="w-5 h-5" style={{ color: 'var(--doc-accent)' }} />
|
||||
<span>
|
||||
hackerspace<span className="doc-accent">.sh</span>{' '}
|
||||
<span style={{ color: 'var(--doc-text-muted)' }}>/ docs</span>
|
||||
</span>
|
||||
</Link>
|
||||
<nav className="docs-header-links">
|
||||
<Link href="/">Home</Link>
|
||||
<Link href="/resources" className="hidden sm:inline">Resources</Link>
|
||||
<Link href="/dashboard" className="docs-header-cta">Open app →</Link>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user