
From Our Docs to Yours: How We Built Our Own Documentation Site with Next.js
Why Not Just Use a Static Site Generator?
Tools like MkDocs and Docusaurus are fantastic, but we wanted our documentation to be a living part of our main application. We wanted to share components, branding, and a unified design system. Next.js, with its hybrid of static site generation (SSG) and server-side rendering (SSR), was the perfect fit.
Our Architecture
Our approach is simple and powerful:
- All documentation is written in standard Markdown files stored in a Git repository.
- On build, Next.js's
generateStaticParamsfunction reads our file structure to discover all available doc pages. - For each page, we use a library called
gray-matterto parse the frontmatter andremarkto convert the Markdown content into HTML on the server. - This content is then passed as a prop to a React Server Component, which renders the final page.
The result is an incredibly fast user experience. You receive a fully-rendered static HTML page, but we retain the power and flexibility of the entire React ecosystem. This post itself is a product of that very system!
.png)




