Headless CMS for Docusaurus
Working with a modern content management system makes updating your Docusaurus site much easier. Instead of editing code every time, you can update docs and blog posts through a visual admin panel.
What is a Headless CMS?
A Headless CMS is a CMS that stores content in Git (your GitHub repo) but provides a visual editor. Unlike WordPress, there is no database. Your content stays as Markdown files in your repo, but you edit them through a nice UI.
Benefits:
- Update your website and blog quickly without coding
- Includes credential security for login on the backend admin
- Your content stays in Git, so you have full control and version history
- No database to maintain, more secure and faster
Two Best Options for Docusaurus
For Docusar, we recommend two solutions:
1. Decap CMS (Formerly Netlify CMS) - For Cloud / Production
This is the best for production. It is free and open source.
- Works perfectly with Netlify, Vercel, and Cloudflare Pages
- You get an admin panel at
yourdomain.com/admin - Login with GitHub / GitLab authentication
- When you save, it commits directly to GitHub and triggers auto-deploy
How to set up Decap CMS:
- Create the file
static/admin/config.ymlin your project:
backend:
name: github
repo: username/your-repo
branch: main
media_folder: "static/img/uploads"
public_folder: "/img/uploads"
collections:
- name: "blog"
label: "Blog"
folder: "blog"
create: true
fields:
- {label: "Title", name: "title", widget: "string"}
- {label: "Description", name: "description", widget: "string"}
- {label: "Date", name: "date", widget: "datetime"}
- {label: "Body", name: "body", widget: "markdown"}
- name: "docs"
label: "Docs"
folder: "docs"
create: true
fields:
- {label: "Title", name: "title", widget: "string"}
- {label: "Body", name: "body", widget: "markdown"}
- Create the file
static/admin/index.html:
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Content Manager</title>
</head>
<body>
<script src="https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js"></script>
</body>
</html>
- Push to GitHub, then go to
yourdomain.com/adminto log in.
2. Tina CMS - For Local Development
This is best if you want to edit visually on your local computer.
- Visual editing directly on your website preview
- Real-time editing, what you see is what you get
- Works in local dev mode:
npm run dev - Git-based, no external service needed
How to set up Tina CMS:
- Install Tina:
npx @tinacms/cli@latest init
- Choose
Docusauruswhen asked for the framework - Tina will create
tina/config.jsfor you - Run your site with Tina:
npm run dev
- Go to
http://localhost:3000/adminto edit.
Which One Should You Use?
- Use Decap CMS if you want your team or client to update blog/docs from anywhere without coding. Best for deployed sites on Netlify or Vercel.
- Use Tina CMS if you are a developer who wants faster local editing with visual preview.
With CMS integration, you can update your Docusar site quickly without needing to open VS Code and edit Markdown manually every time.