Nextra Documentation Template
A starter template for documentation sites built with Nextra 4 and Next.js 15 .
This template is configured for static export, full-text search via Pagefind, LaTeX math, and the full Nextra docs theme.
What’s Included
- Static export configuration (
output: 'export') for deployment to any static host - Pagefind search indexing wired into the build
- LaTeX rendering via KaTeX
- A custom
<Callout>component alongside Nextra’s built-ins - Example content covering every supported component and markdown element — see the Style Guide
Project Structure
src/
├── app/
│ ├── layout.tsx # Root layout with Nextra theme
│ └── [[...slug]]/
│ └── page.tsx # Dynamic page handler
├── components/
│ └── Callout.tsx # Custom callout component
├── content/
│ ├── _meta.js # Sidebar configuration
│ ├── index.mdx # This page
│ └── styleguide.mdx # Component & element reference
└── mdx-components.tsx # MDX component registrationAdding Pages
- Create a new
.mdxfile insrc/content/ - Add an entry to
src/content/_meta.jsto control sidebar order and title - Write your content using any of the components shown in the Style Guide
Running Locally
npm install
npm run devOpen http://localhost:3000 .
Building
npm run buildThe static site is written to out/ with a Pagefind index at out/_pagefind/.
Last updated on