# Buidling Documentation Website

> Realworld edge cases

_Published 2025-12-04_

_Author: Shrey Vijayvargiya_

## Overview

Hello and welcome to today's blog

Recently, I got an email from a person asking how he can make a documentation website. He was using Mintlify and Fuma docs, but was not satisfied

Mintlify was too costly $300/month, and Fuma Docs is open-source, needing some manual reading and onboarding as a time-consuming process

My very first reaction is to create static documentation using Nextjs react-markdown and use file-based routing to render content from a markdown file

1. Install Nextjs latest repository
2. Add tailwind, shadcn optional and react-markdown with next/mdx npm packages
3. Add markdown files inside the content directory in the root directory. This will contain all markdown files
4. Create a content mapping object, /docs/introduction will fetch content from docs/introduction.mdx file and so on
5. Write a method to read and return the file content using the <b>fs</b> module
6. Render the content inside React jsx and in the dynamic routing, set he meta tags accordingly for each page

I personally use this process to quickly create documentation, and because of the following reasons, I prefer markdown and hardcoding of a database instead

1. Hard-coding makes the website static and gives search engines better reading capability
2. No database, no API cost, zero headaches
3. Markdown support works for all kinds of developers and people

<b>Nested Routing and Multiple Tabs</b>

The client was asking for further updates, such as Tabs and versioning, and that was the tricky part, but we have a solution

Tabs are again handled via routing, each tab takes to a new route, and each route uses the mapping to find the content from the markdown file

Each route for tabs contains the Sidebar content or a list of children routes, for example, <a href="https://docs-template-henna.vercel.app/docs/bootup/introduction">https://docs-template-henna.vercel.app/docs/bootup/introduction</a> and <a href="https://docs-template-henna.vercel.app/docs/bootup/migrate-to-docs">https://docs-template-henna.vercel.app/docs/bootup/migrate-to-docs</a>, both are content for the Bootup tab that contains Introduction and Migrate to Docs as the sidebar children routes in the sidebar, check the image below

![The Docs page contains multiple nested routes for each parent route](https://firebasestorage.googleapis.com/v0/b/ihatereading-4ba52.appspot.com/o/Logs%2FQXq1wZdVU3X7pGJJjdiB2JSavdk1%2Fimages%2FScreenshot%202025-12-04%20at%208.21.58%E2%80%AFPM.png?alt=media&amp;token=ead190ba-d989-4aef-b6ae-6c2ada44b25b)

We are using the Sidebar route mapping object that maps the current parent route to provide children routes for the Sidebar

For example, if the Docs page is the parent route, then the Sidebar content will change, and so will it for Guides and Api Reference and Support

Check the video below

![](https://firebasestorage.googleapis.com/v0/b/ihatereading-4ba52.appspot.com/o/Logs%2FQXq1wZdVU3X7pGJJjdiB2JSavdk1%2Fimages%2FScreenRecording2025-12-04at8.23.49PM-ezgif.com-video-to-gif-converter%20(1).gif?alt=media&amp;token=179748ad-c817-41b5-9ed9-69dc39da46d7)

<b>Handling Responsiveness</b>

A few things I was considering for small devices are the sidebar and the Navbar, because the content part will remain the same

Navbar, we mostly need to add the toggle sidebar icon for small devices

Sidebar becomes an actual Sidebar with fixed as the CSS rendering Sidebar content inside a modal on the left-hand side. I prefer using motion from framer-motion and Tailwind CSS to quickly add CSS and animate the div from the left side, looking more like a sidebar

![](https://firebasestorage.googleapis.com/v0/b/ihatereading-4ba52.appspot.com/o/Logs%2FQXq1wZdVU3X7pGJJjdiB2JSavdk1%2Fimages%2FScreenRecording2025-12-04at8.34.49PM-ezgif.com-video-to-gif-converter.gif?alt=media&amp;token=d81108b9-75f5-4c22-be0a-cca0f63925c3)

Now the final easy documentation website is ready

1. Nextjs and Tailwind latest source code
2. Hard-coded, SEO optimised documentation template
3. Multiple routes, nested routes with copy content and a Table of Contents
4. Responsive source code for small and large devices
5. AI chatbot in the right sidebar to Chat with AI just like mintlify

<a href="https://docs-template-henna.vercel.app/" target="_blank" rel="external">Check out the template demo</a>

<a href="https://shreyvijayvargiya.gumroad.com/l/frontend-documentation-nextjs-template?layout=profile" target="_blank" rel="external">Get the source code</a>

That's it for today

Shrey

---

Canonical HTML: https://ihatereading.in/blogs/buidling-documentation-website
Markdown: https://ihatereading.in/blogs/buidling-documentation-website.md
