Skip to main content

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:

  1. Create the file static/admin/config.yml in 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"}
  1. 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>
  1. Push to GitHub, then go to yourdomain.com/admin to 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:

  1. Install Tina:
npx @tinacms/cli@latest init
  1. Choose Docusaurus when asked for the framework
  2. Tina will create tina/config.js for you
  3. Run your site with Tina:
npm run dev
  1. Go to http://localhost:3000/admin to 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.