How to turn markdown files into a documentation website
The ways to publish a folder of markdown as a docs site: a static site generator, a hosted docs platform, or a host that reads the repository directly.
By Gusenga Thierry ·
The short answer
Either run a static site generator such as Docusaurus or MkDocs, which builds your markdown into HTML you host yourself, or use a host that reads the markdown from your Git repository and serves it as a site. The first gives full control over design; the second skips the build and config, and can add access control.
What are the options?
You have a folder of .md files, probably in a Git repository, and you want a
website with a sidebar, page titles and links that work. There are two broad
ways to get there.
A static site generator. Docusaurus, MkDocs, Hugo, VitePress and others read your markdown, apply a theme and write HTML files. You host the output on GitHub Pages, Netlify, Vercel, Cloudflare Pages or your own server. You control everything, and you maintain everything: the config, the theme, the build, the dependency upgrades and the hosting.
A host that reads the repository. A service reads the markdown from the repository on each push and serves it as a site. There is no build for you to run, and less to configure. You give up control over layout in exchange.
Neither is wrong. The question is how much of the site you want to own.
When is a static site generator the right choice?
Choose a generator when:
- You want a custom design, landing page or React components inside your docs.
- You need versioned docs (v1, v2, v3) side by side; Docusaurus does this well.
- Your docs must be public and you already have hosting you like.
- You have someone who will maintain the build when a dependency breaks.
Generators are free and well documented. Their gap is access control: they produce static files and have no login. If some of your docs should be private, the protection has to come from the host or a proxy in front of it. See how to password protect a documentation site.
When is a hosted reader the right choice?
Choose a host that reads the repository when:
- The markdown already exists and you want it readable today.
- You do not want a config file to keep in step with your folders.
- Some readers should see the docs and others should not.
- People who are not developers need to fix a typo without cloning anything.
How does DocuGate turn a folder into a site?
DocuGate reads one folder, on one branch, of a GitHub repository. The rules are short, and there is no config file you have to write:
docs/
index.md -> /acme/handbook
installation.md -> /acme/handbook/installation
guides/
deploying.md -> /acme/handbook/guides/deploying
- Only
.mdfiles become pages..MDworks too. - A folder becomes a sidebar group, named after the folder with dashes and underscores turned into spaces. Nested folders nest.
- A file's title is its first
#heading; without one, the file name. index.mdis the landing page. Without it,README.mdstands in.- Pages sort with the index first, then files by title, then folders.
If you want a fixed order, add docugate.json at the repository root:
{
"sidebar": ["index.md", "quickstart.md", "guides"]
}
Anything not listed is appended after. See connecting a repository for the rest.
Content is cached per commit. Push to the branch and the next reader gets the new pages. Nothing is copied into DocuGate permanently.
What else comes with it?
- Access control. Each space is Public, Repo access (GitHub decides who can read) or Allowlist (named GitHub logins or emails). See access control.
- Edit in place. Anyone who can push to the repository sees Edit on a page. The change commits to the branch as them.
- An API reference. Commit an OpenAPI 3.0 or 3.1 file and the space gains a page per endpoint with examples and a console. See API reference.
- Several repositories in one space. On Pro, a frontend, a backend and a mobile app can publish into one set of pages. See merging repositories.
- Checks before you publish.
npx docugate checkcatches broken links and pages without titles, and can run in CI. See the CLI.
What it does not do: custom themes and layouts. You get DocuGate's reader, with light and dark mode, an accent colour and a density setting. If the design of your docs site is part of your brand, a generator gives you more room.
Steps
- Put your markdown in a folder, such as
docs, with anindex.mdorREADME.md. - Start each page with a
#heading. - Optionally run
npx docugate initandnpx docugate checkin the repository. - Sign up with GitHub and open Dashboard → New space.
- Pick the repository, branch and folder, choose who can read, and create the space.
- Open it at
/{your-handle}/{slug}.
One space from a public repository is free on Starter. Unlimited spaces and private repositories are on Pro, at $5 a month, $50 a year or $2 a week. See pricing.
Try it
Create a space from a folder of markdown you already have.
Questions people also ask
Do I need a config file to get a sidebar?
With most static site generators, yes, or a convention you have to learn. With DocuGate, no: folders become sidebar groups and each file's first heading becomes its title. An optional docugate.json fixes the order if you want one.
Can I keep my docs in the same repository as my code?
Yes, and it is usually the better choice. Docs change in the same pull request as the code they describe, and reviewers see both.
What happens to my README files?
In DocuGate, a folder's README.md becomes its landing page when there is no index.md, so most repositories need nothing renamed.
Can I make the website private?
Static site generators have no login of their own; you add one at the host. DocuGate has three access modes per space: Public, Repo access and Allowlist.
Read next
- What is docs-as-code?: Docs-as-code explained: documentation written in plain text, kept in Git beside the code, reviewed in pull requests and published automatically.
- Shipping a docs site without a sidebar config file: How DocuGate builds navigation from the folders, headings and index files already in a repository, and the one optional file for what folders cannot say.
- How to publish private documentation from a GitHub repo: Turn the markdown in a private GitHub repository into a docs site only the right people can read, without a second permission list to maintain.
- A GitBook alternative for gated docs from GitHub: DocuGate and GitBook compared on price, access control and editing, as of October 2026, including when GitBook is the better choice.
Get started with DocuGate, free.