Convert Figma logo to code with AI

decaporg logodecap-cms

A Git-based CMS for Static Site Generators

17,787
3,032
17,787
483

Top Related Projects

17,783

A Git-based CMS for Static Site Generators

62,681

🚀 Strapi is the leading open-source headless CMS. It’s 100% JavaScript/TypeScript, fully customizable and developer-first.

14,464

Modern, Crazy Fast, Ridiculously Easy and Amazingly Powerful Flat-File CMS powered by PHP, Markdown, Twig, and Symfony

48,920

:globe_with_meridians: Jekyll is a blog-aware static site generator in Ruby

55,199

The best React-based framework with performance, scalability and security built in.

74,645

The world’s fastest framework for building websites.

Quick Overview

Decap CMS (formerly Netlify CMS) is an open-source content management system for static site generators. It provides a user-friendly interface for content creators to manage and edit website content without needing to understand the underlying code or deployment processes. Decap CMS integrates seamlessly with static site generators like Hugo, Gatsby, and Jekyll.

Pros

  • Easy to use interface for non-technical content editors
  • Git-based content management, allowing version control and collaboration
  • Customizable content types and widgets
  • Integrates well with popular static site generators and hosting platforms

Cons

  • Limited built-in features compared to traditional CMS platforms
  • Requires some technical knowledge for initial setup and configuration
  • May not be suitable for large-scale, complex websites with dynamic content
  • Limited plugin ecosystem compared to more established CMS solutions

Code Examples

  1. Basic configuration (config.yml):
backend:
  name: git-gateway
  branch: main
media_folder: "static/images"
public_folder: "/images"
collections:
  - name: "blog"
    label: "Blog"
    folder: "content/blog"
    create: true
    fields:
      - {label: "Title", name: "title", widget: "string"}
      - {label: "Publish Date", name: "date", widget: "datetime"}
      - {label: "Body", name: "body", widget: "markdown"}
  1. Custom widget registration:
import CustomWidget from './CustomWidget'

CMS.registerWidget('custom', CustomWidget)
  1. Custom preview component:
import React from 'react'

const BlogPostPreview = ({ entry, widgetFor }) => (
  <div>
    <h1>{entry.getIn(['data', 'title'])}</h1>
    <div>{widgetFor('body')}</div>
  </div>
)

CMS.registerPreviewTemplate('blog', BlogPostPreview)

Getting Started

  1. Add the Decap CMS script to your HTML:
<script src="https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js"></script>
  1. Create a config.yml file in the /admin directory of your site:
backend:
  name: git-gateway
  branch: main
media_folder: "static/images"
public_folder: "/images"
collections:
  - name: "pages"
    label: "Pages"
    files:
      - label: "Home"
        name: "home"
        file: "content/home.md"
        fields:
          - {label: "Title", name: "title", widget: "string"}
          - {label: "Body", name: "body", widget: "markdown"}
  1. Create an index.html file in the /admin directory:
<!doctype html>
<html>
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Content Manager</title>
</head>
<body>
  <script src="https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js"></script>
</body>
</html>
  1. Deploy your site and enable Identity and Git Gateway services if using Netlify.

Competitor Comparisons

17,783

A Git-based CMS for Static Site Generators

Pros of Decap CMS

  • More active development and recent updates
  • Larger community and contributor base
  • Better documentation and examples

Cons of Decap CMS

  • Potentially more complex setup for simple use cases
  • May have more features than necessary for some projects

Code Comparison

Decap CMS configuration example:

backend:
  name: git-gateway
  branch: main
media_folder: "static/images"
public_folder: "/images"
collections:
  - name: "blog"
    label: "Blog"
    folder: "content/blog"
    create: true
    fields:
      - {label: "Title", name: "title", widget: "string"}
      - {label: "Body", name: "body", widget: "markdown"}

Both repositories appear to be the same project, with Decap CMS being the main and actively maintained version. The comparison above is based on the assumption that one repository might be an older or alternative version. However, since they are likely the same project, the actual differences may be minimal or non-existent.

In this case, it's recommended to use the Decap CMS repository (decaporg/decap-cms) as it appears to be the primary and most up-to-date version of the project.

62,681

🚀 Strapi is the leading open-source headless CMS. It’s 100% JavaScript/TypeScript, fully customizable and developer-first.

Pros of Strapi

  • More comprehensive headless CMS solution with built-in API generation
  • Offers a user-friendly admin panel for content management
  • Supports multiple databases (SQLite, PostgreSQL, MySQL, MariaDB)

Cons of Strapi

  • Requires server-side setup and hosting
  • Steeper learning curve for developers
  • More resource-intensive compared to static CMS solutions

Code Comparison

Strapi (API route definition):

module.exports = {
  routes: [
    {
      method: 'GET',
      path: '/articles',
      handler: 'article.find',
      config: { policies: [] }
    }
  ]
};

Decap CMS (config file):

collections:
  - name: "blog"
    label: "Blog"
    folder: "_posts/blog"
    create: true
    fields:
      - {label: "Title", name: "title", widget: "string"}
      - {label: "Body", name: "body", widget: "markdown"}

Key Differences

  • Strapi is a full-featured headless CMS with a backend, while Decap CMS is a Git-based CMS for static site generators
  • Strapi provides more flexibility in terms of content modeling and API customization
  • Decap CMS is easier to set up and integrate with static sites, requiring no backend infrastructure
  • Strapi offers more advanced features like user roles and permissions, while Decap CMS focuses on simplicity and Git-based workflows
14,464

Modern, Crazy Fast, Ridiculously Easy and Amazingly Powerful Flat-File CMS powered by PHP, Markdown, Twig, and Symfony

Pros of Grav

  • Standalone CMS with no database requirement, using flat-file architecture
  • Highly extensible with a rich plugin ecosystem
  • Lightweight and fast performance due to its file-based structure

Cons of Grav

  • Steeper learning curve for non-technical users compared to Decap CMS
  • Less suitable for large-scale websites with complex data relationships
  • Limited built-in support for static site generation

Code Comparison

Grav (PHP):

$page = $this->grav['page'];
$config = $this->grav['config'];
$twig = $this->grav['twig'];
$twig->twig_vars['custom_variable'] = 'value';

Decap CMS (JavaScript):

import CMS from 'decap-cms-app';
CMS.init();
const config = {
  backend: { name: 'git-gateway', branch: 'main' },
  collections: [/* ... */]
};

Both Grav and Decap CMS offer content management solutions, but they cater to different use cases. Grav is a standalone CMS that excels in simplicity and speed, while Decap CMS focuses on providing a user-friendly interface for managing content in static site generators. The choice between them depends on the specific project requirements and the development team's expertise.

48,920

:globe_with_meridians: Jekyll is a blog-aware static site generator in Ruby

Pros of Jekyll

  • Mature and widely adopted static site generator with a large community
  • Extensive plugin ecosystem for added functionality
  • Seamless integration with GitHub Pages for easy deployment

Cons of Jekyll

  • Requires Ruby knowledge for advanced customization
  • Slower build times for large sites compared to modern alternatives
  • Less intuitive for non-technical users without a content management interface

Code Comparison

Jekyll (Liquid template):

{% for post in site.posts %}
  <h2>{{ post.title }}</h2>
  <p>{{ post.excerpt }}</p>
{% endfor %}

Decap CMS (React component):

const PostList = ({ posts }) => (
  <>
    {posts.map(post => (
      <div key={post.id}>
        <h2>{post.title}</h2>
        <p>{post.excerpt}</p>
      </div>
    ))}
  </>
)

Summary

Jekyll is a mature static site generator with a large ecosystem, while Decap CMS focuses on providing a user-friendly content management interface for static sites. Jekyll offers more flexibility for developers but may be less accessible for non-technical users. Decap CMS simplifies content management but may have limitations in advanced customization compared to Jekyll's extensive plugin system.

55,199

The best React-based framework with performance, scalability and security built in.

Pros of Gatsby

  • More comprehensive framework with built-in performance optimizations
  • Larger ecosystem with extensive plugins and themes
  • Strong GraphQL integration for efficient data handling

Cons of Gatsby

  • Steeper learning curve, especially for developers new to React or GraphQL
  • Can be overkill for simpler projects or static sites
  • Longer build times for large sites due to complex data processing

Code Comparison

Gatsby (React-based component):

import React from "react"
import { graphql } from "gatsby"

export default function BlogPost({ data }) {
  const post = data.markdownRemark
  return <div dangerouslySetInnerHTML={{ __html: post.html }} />
}

export const query = graphql`
  query($slug: String!) {
    markdownRemark(fields: { slug: { eq: $slug } }) {
      html
    }
  }
`

Decap CMS (Config file):

backend:
  name: git-gateway
  branch: main

media_folder: "static/images"
public_folder: "/images"

collections:
  - name: "blog"
    label: "Blog"
    folder: "content/blog"
    create: true
    fields:
      - { label: "Title", name: "title", widget: "string" }
      - { label: "Body", name: "body", widget: "markdown" }
74,645

The world’s fastest framework for building websites.

Pros of Hugo

  • Faster build times and better performance for large sites
  • More extensive theming and templating capabilities
  • Larger ecosystem with a wide range of themes and plugins

Cons of Hugo

  • Steeper learning curve, especially for non-technical users
  • Less intuitive content management for non-developers
  • Requires local development environment setup

Code Comparison

Hugo (Go template):

{{ range .Pages }}
  <h2>{{ .Title }}</h2>
  {{ .Content }}
{{ end }}

Decap CMS (React component):

{entries.map(entry => (
  <div key={entry.id}>
    <h2>{entry.data.title}</h2>
    {entry.data.body}
  </div>
))}

Hugo focuses on static site generation using Go templates, while Decap CMS provides a React-based admin interface for content management. Hugo excels in performance and flexibility for developers, whereas Decap CMS offers a more user-friendly approach for content editors. Hugo requires more technical knowledge but provides greater control over the site structure and build process. Decap CMS integrates well with static site generators and offers a familiar CMS experience, making it easier for non-technical users to manage content.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Decap CMS

GitHub license Netlify Status npm version Build Status PRs Welcome

decapcms.org

A CMS for static site generators. Give users a simple way to edit and add content to any site built with a static site generator.

Decap CMS is the new name of Netlify CMS since February 2023.

Community Chat

Join us on Discord

How It Works

Decap CMS is a single-page app that you pull into the /admin part of your site.

It presents a clean UI for editing content stored in a Git repository.

You setup a YAML config to describe the content model of your site, and typically tweak the main layout of the CMS a bit to fit your own site.

When a user navigates to /admin/ they'll be prompted to log in, and once authenticated they'll be able to create new content or edit existing content.

Read more about Decap CMS Core Concepts.

Installation and Configuration

The Decap CMS can be used in two different ways.

  • A Quick and easy install, that requires you to create a single HTML file and a configuration file. All the CMS JavaScript and CSS are loaded from a CDN. To learn more about this installation method, refer to the Quick Start Guide
  • A complete, more complex install, that gives you more flexibility but requires that you use a static site builder with a build system that supports npm packages.

Contributing

New contributors are always welcome! Check out CONTRIBUTING.md to get involved.

Change Log

This project adheres to Semantic Versioning. Every release is documented on the GitHub Releases page.

License

Decap CMS is released under the MIT License. Please make sure you understand its implications and guarantees.

Maintainers

Maintained with care by PM TechHub & friends.

Professional help

Our partners offer a range of services that can help you get the most out of Decap CMS. Find onboarding, priority support, and development of custom features.

Read more on our professional help page

NPM DownloadsLast 30 Days