A modern documentation site template built with Nextra, Next.js 15, and React 19.
- Next.js 15 with App Router
- React 19 with latest features
- Nextra 4 documentation framework
- Tailwind CSS 4 for styling
- TypeScript for type safety
- Pagefind for full-text search
- Mermaid for diagrams with zoom/pan controls
- KaTeX for math rendering
- Dark mode support
# Install dependencies
pnpm install
# Start development server
pnpm dev
# Build for production
pnpm build
# Preview production build
pnpm startdoc-template/
+-- src/
| +-- app/ # Next.js App Router
| | +-- _components/ # Shared React components
| | +-- _constants/ # Project constants
| | +-- _utils/ # Utility functions
| | +-- [[...mdxPath]]/ # Dynamic MDX routing
| | +-- layout.tsx # Root layout
| | +-- metadata.ts # Site metadata
| +-- content/ # MDX documentation files
| | +-- _meta.ts # Navigation configuration
| | +-- index.mdx # Home page
| | +-- getting-started/ # Getting started section
| | +-- guides/ # Guides section
| +-- mdx-components.ts # MDX component mappings
| +-- styles/
| +-- globals.css # Global styles
+-- public/ # Static assets
+-- mdx-components.tsx # MDX re-export
+-- next.config.ts # Next.js configuration
+-- tailwind.config.js # Tailwind configuration
+-- tsconfig.json # TypeScript configuration
+-- package.json
Edit src/app/_constants/project.ts:
export const BASE_URL = "https://your-docs.com";
export const GITHUB_REPO_URL = "https://github.com/your-org/your-docs";
export const PROJECT_URL = "https://github.com/your-org/your-docs";Edit src/app/metadata.ts with your site information.
Edit src/app/layout.tsx to update the logo and navbar.
- Create a new
.mdxfile insrc/content/ - Add frontmatter:
---
title: Page Title
description: Page description
---
# Content here- Update the corresponding
_meta.tsfile
Navigation is controlled via _meta.ts files:
export default {
"page-filename": "Display Title",
"another-page": "Another Title",
};<MermaidDiagram id="unique-id" chart={`
graph TD
A[Start] --> B[End]
`} />MIT