Skip to content

Backends

A backend defines where your content is stored and how Sveltia CMS interacts with it. Sveltia CMS primarily supports Git-based backends, allowing seamless integration with popular Git hosting services.

Supported Backends

Sveltia CMS supports the following Git-based backends:

For testing purposes, you can also use the Test Backend.

Some features only work with specific backends. For example, Editorial Workflow currently only works with the GitHub and GitLab backends.

Breaking changes from Netlify/Decap CMS

Sveltia CMS does not support the Azure DevOps, Bitbucket and Git Gateway backends for performance reasons. Note that Git Gateway is now officially deprecated by Netlify. If you use one of these backends in Netlify/Decap CMS, consider switching to GitHub, GitLab, Gitea or Forgejo before migrating to Sveltia CMS.

Also, Sveltia CMS does not support the undocumented custom backend API. The CMS.registerBackend method is a noop in Sveltia CMS. We may add support for custom backends in future releases.

Configuration

All the configuration options for backends can be set in the backend option of your CMS configuration file. Here is a basic example of configuring the GitHub backend:

yaml
backend:
  name: github
  repo: user/repo
toml
[backend]
name = "github"
repo = "user/repo"
json
{
  "backend": {
    "name": "github",
    "repo": "user/repo"
  }
}
js
{
  backend: {
    name: "github",
    repo: "user/repo",
  },
}

See the specific backend guides for detailed configuration instructions.

The following sections describe some common configuration options available for all Git-based backends.

Branch Selection

By default, Sveltia CMS interacts with the repository’s default branch (usually main or master). You can specify a different branch using the branch option in the backend configuration:

yaml
backend:
  name: github
  repo: user/repo
  branch: develop
toml
[backend]
name = "github"
repo = "user/repo"
branch = "develop"
json
{
  "backend": {
    "name": "github",
    "repo": "user/repo",
    "branch": "develop"
  }
}
js
{
  backend: {
    name: "github",
    repo: "user/repo",
    branch: "develop",
  },
}

Commit Messages

You can customize the Git commit messages used when saving content. The commit_messages option allows you to define templates for various actions. Here’s the default configuration:

yaml
backend:
  commit_messages:
    create: 'Create {{collection}} "{{slug}}"'
    update: 'Update {{collection}} "{{slug}}"'
    delete: 'Delete {{collection}} "{{slug}}"'
    uploadMedia: 'Upload "{{path}}"'
    deleteMedia: 'Delete "{{path}}"'
    openAuthoring: '{{message}}'
toml
[backend.commit_messages]
create = "Create {{collection}} \"{{slug}}\""
update = "Update {{collection}} \"{{slug}}\""
delete = "Delete {{collection}} \"{{slug}}\""
uploadMedia = "Upload \"{{path}}\""
deleteMedia = "Delete \"{{path}}\""
openAuthoring = "{{message}}"
json
{
  "backend": {
    "commit_messages": {
      "create": "Create {{collection}} \"{{slug}}\"",
      "update": "Update {{collection}} \"{{slug}}\"",
      "delete": "Delete {{collection}} \"{{slug}}\"",
      "uploadMedia": "Upload \"{{path}}\"",
      "deleteMedia": "Delete \"{{path}}\"",
      "openAuthoring": "{{message}}"
    }
  }
}
js
{
  backend: {
    commit_messages: {
      create: 'Create {{collection}} "{{slug}}"',
      update: 'Update {{collection}} "{{slug}}"',
      delete: 'Delete {{collection}} "{{slug}}"',
      uploadMedia: 'Upload "{{path}}"',
      deleteMedia: 'Delete "{{path}}"',
      openAuthoring: '{{message}}',
    },
  },
}

The available commit types are:

  • create, update, delete: Used when creating, updating, or deleting entries in collections.
  • uploadMedia, deleteMedia: Used when uploading or deleting media assets.
  • openAuthoring: Used when submitting changes via open authoring (fork and pull request).

TIP

Unlike most of other config options, the commit message keys are camelCased.

Available Template Tags

You can use the following template tags in commit messages:

  • {{collection}}: The label_singular or label of the collection.
  • {{slug}}: The slug of the entry.
  • {{path}}: The file path of the media asset.
  • {{message}}: The original commit message provided by the user.
  • {{author-email}}: The email of the signed-in user, if available.
  • {{author-login}}: The login name of the signed-in user, if available.
  • {{author-name}}: The display name of the signed-in user, if available.

The following table summarizes which tags are supported for each commit type:

Commit TypeSupported Tags
create, update, deletecollection, slug, path, author-email, author-login, author-name
uploadMedia, deleteMediapath, author-email, author-login, author-name
openAuthoringmessage, author-email, author-login, author-name

Skipping CI/CD

It’s also possible to add the [skip ci] prefix to commit messages to prevent triggering CI/CD pipelines. See the deployments guide for more details.

Future Plans

We plan to add an option that prompts users to enter custom commit messages in the UI before saving changes.

Released under the MIT License.