Documentation
Documentation Site
How this marketing and docs site works.
The PaperCast documentation is integrated directly into the Next.js application under the (marketing) route group.
Structure
The documentation relies on two main components:
- MDX Files: Content is written in Markdown with React components (
.mdx). These files live in the/content/docsdirectory. - Docs App Router: The Next.js catch-all route at
src/app/(marketing)/docs/[slug]/page.tsxdynamically imports and renders the requested.mdxfile.
The Sidebar and Config
Navigation is driven by a central configuration file.
src/app/(marketing)/docs/config.ts
This file exports a DOC_CATEGORIES array. It dictates exactly what appears in the DocsSidebar and in what order.
export const DOC_CATEGORIES: DocCategory[] = [
{
title: "Getting Started",
pages: [
{
id: "getting-started",
title: "Getting Started",
description: "Learn the basics.",
},
],
},
// ...
];
Adding a New Documentation Page
If you create a new feature and need to document it:
- Create a new file (e.g.,
my-feature.mdx) in thecontent/docsdirectory. - Write your content using standard Markdown. You can include React components like
<Callout>. - Open
src/app/(marketing)/docs/config.ts. - Locate the appropriate category in the
DOC_CATEGORIESarray. - Add an entry matching your filename (without the
.mdxextension):{ id: "my-feature", title: "My Feature", description: "A brief summary." }
Auto-Navigation
By adding your page to config.ts, the Next and Previous buttons at the
bottom of the documentation pages will automatically link to your new page in
the correct flow!