Get started
Documentation menu

Guides

Sveltia CMS setup

The pages collection, the page format, and the backends you can use.

vamped editor adds field types to Sveltia CMS; it doesn’t replace any of Sveltia’s configuration. Everything lives in public/admin/config.yml, as on any Sveltia site.

The pages collection

collections:
  - name: pages
    label: Pages
    folder: src/content/pages
    extension: yml
    format: page-yaml
    create: true
    identifier_field: title
    slug: '{{slug}}'
    editor:
      preview: false
    fields:
      - { name: title, label: Page title, widget: page-field }
      - { name: description, label: SEO description, widget: page-field, multiline: true, required: false }
      - { name: sections, label: Page content, widget: visual-blocks }
  • name: pages is required: the editor looks for this collection.
  • widget: visual-blocks is the visual editor. It edits the page’s sections.
  • widget: page-field shows the page’s title and SEO description in the editor’s Page settings, next to the blocks.
  • format: page-yaml writes every page file in the same layout (keys sorted, no null values), whoever saved it. Diffs stay small and predictable.
  • editor: preview: false hides Sveltia’s own preview pane; the visual editor has its own.

A page file looks like this:

title: Home
description: The open-source visual editor for Astro and Sveltia CMS.
sections:
  - id: hero-v4mp3d
    props:
      heading: Your content. With a little
      highlight: more bite.
    type: hero

Other collections

Everything else is plain Sveltia: settings files, blog posts in Markdown, media. This website’s documentation, for example, is a regular Sveltia collection of Markdown files.

Backends

Sveltia signs people in and saves, with the backend from config.yml. The editor works with all of them:

  • GitHub, GitLab, Gitea/Forgejo, signed in with the provider or an access token.
  • Sveltia CMS Additions for GitHub: usernames and passwords, roles, and sign-in without a GitHub account. Add auth_type: additions and base_url to the backend.
  • Work with Local Repository on localhost (Chrome or Edge): edits your project folder directly, no sign-in.
  • name: test-repo: Sveltia’s test backend, which keeps content in the browser. Handy for trying blocks out.

For sites without Git, the package has an optional file backend of its own; see accounts in Integration options.