A dead-simple template for turning a folder of markdown files into a Nextra docs site.
- Install dependencies with
npm install. - Put your markdown files in
docs-src/. - Use numeric prefixes (like
01-,02-) to control sidebar order. - Run
npm run sync-docsto generate the Nextraapp/routes. - Run
npm run dev.
- Each file becomes a route.
index.mdbecomes the section landing page.- Folders become sidebar sections automatically.
Example:
docs-src/
index.md
01-getting-started.md
02-guides/
index.md
01-installation.md
npm run sync-docsgenerates theapp/directory fromdocs-src/.npm run devsyncs docs and starts the dev server.npm run buildsyncs docs and builds the site.
app/is generated fromdocs-src/on each sync.- If you need custom pages, put them in
docs-src/or extend the sync script. - Search is generated on build via Pagefind (
npm run buildrunspostbuild).
Set the project root to this folder and use the default Next.js settings.