Decap CMS Integration with Static Site Generators

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1 servicesAll 2065 services
Decap CMS Integration with Static Site Generators
Simple
from 1 business day to 3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    847
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Decap CMS Integration with Static Site Generators

Decap CMS doesn't depend on specific SSG — works with filesystem and Git. But each generator has conventions for content structure, frontmatter, file paths. Proper integration means CMS writes files in format SSG understands without extra processing.

Next.js + Decap CMS

Next.js reads content via fs, gray-matter, or @next/mdx. Example scheme:

# public/admin/config.yml
backend:
  name: github
  repo: myorg/my-next-site
  branch: main

media_folder: public/images
public_folder: /images

collections:
  - name: posts
    label: Articles
    folder: _content/posts
    create: true
    slug: "{{slug}}"
    extension: mdx
    format: frontmatter
    fields:
      - { label: Title, name: title, widget: string }
      - { label: Date, name: date, widget: datetime }
      - { label: Body, name: body, widget: markdown }

Read in Next.js:

// lib/posts.ts
import fs from 'fs'
import path from 'path'
import matter from 'gray-matter'

const postsDir = path.join(process.cwd(), '_content/posts')

export function getAllPosts() {
  const files = fs.readdirSync(postsDir)
  return files
    .filter(f => f.endsWith('.mdx'))
    .map(file => {
      const raw = fs.readFileSync(path.join(postsDir, file), 'utf8')
      const { data, content } = matter(raw)
      return { slug: file.replace('.mdx', ''), ...data, content }
    })
}

Astro + Decap CMS

Astro has built-in Content Collections system validating frontmatter via Zod. Config must match:

# Decap collection
collections:
  - name: blog
    folder: src/content/blog
    fields:
      - { name: title, widget: string }
      - { name: pubDate, widget: datetime }
      - { name: body, widget: markdown }
// src/content/config.ts
import { defineCollection, z } from 'astro:content'

const blog = defineCollection({
  type: 'content',
  schema: z.object({
    title: z.string(),
    pubDate: z.coerce.date(),
  }),
})

export const collections = { blog }

Hugo + Decap CMS

Hugo uses content/ directory. Frontmatter can be YAML, TOML, or JSON. Decap writes YAML by default:

# static/admin/config.yml
collections:
  - name: posts
    label: Posts
    folder: content/posts
    create: true
    slug: "{{slug}}"
    fields:
      - { name: title, widget: string }
      - { name: date, widget: datetime }
      - { name: body, widget: markdown }

Hugo template reads without adapters — frontmatter available as .Params:

{{/* layouts/posts/single.html */}}
<article>
  <h1>{{ .Title }}</h1>
  <time>{{ .Date.Format "02.01.2006" }}</time>
  {{ .Content }}
</article>

Netlify/Vercel Auto-Deploy Webhook

When editor publishes, Decap commits to Git. Need to trigger build:

Netlify — Build Hooks:

Settings → Build & deploy → Build hooks → Add build hook

Copy URL and add to GitHub repo Settings → Webhooks.

Vercel — Deploy Hooks:

Project Settings → Git → Deploy Hooks

URL like https://api.vercel.com/v1/integrations/deploy/prj_xxx/yyy.

Preview of Drafts

With editorial_workflow: true, drafts live in separate branches. For preview, setup Deploy Previews:

  • Netlify auto-deploys each branch on unique URL
  • Vercel does same via Preview Deployments

Editor sees "Preview" button — opens draft's preview deploy.

Timeline

Integration with existing SSG: 1 day. With i18n, editorial workflow: 2–3 days.