Get started
Documentation menu

Start here

Introduction

What vamped editor is, how it works, and what it needs.

vamped editor (@vamped/editor) adds a visual block editor to Sveltia CMS for Astro websites. Editors build pages from blocks, click any block in a live preview to edit it, and see the unsaved draft rendered by your real Astro components, exactly as the published page will look.

Preview release (0.x). The API will change between minor versions. These docs describe 0.2.0, tested with Sveltia CMS 5.0.2 and Astro 7.4.5. Until 0.2.0 is on npm, @vamped/editor@next installs 0.1.0, which still needs the package’s own sign-in and works differently.

How it works

  • A field type for Sveltia. The editor is a custom Sveltia field, visual-blocks. A page’s content is a list of blocks, saved as plain YAML in your repository: sections: [{ id, type, props }]. Sveltia still does everything else: signing in, saving to Git, media, other collections.
  • Your blocks, described once. Each block type is one defineBlock call with a Zod schema, default values and a list of fields, plus one Astro component. The block library, the inspector, validation and the saved file all come from that description.
  • A live preview from your own components. While astro dev runs, the integration adds a preview route. The editor sends it the unsaved draft, the route renders it with your layout and block components, and the preview updates only the blocks that changed, without reloading.
  • Click to edit. Small data-ve-* markers in the preview HTML tell the editor which block and which field you clicked. They are added only in the preview, so the published HTML stays clean.
  • A static site. astro build produces the same static site as before. No editor code, no adapter and no server end up in your pages.

What you need

  • An Astro site (Astro 7.4.5 or later), served from the root of its domain (base: '/').
  • Sveltia CMS 5.0.2 or later, with any backend it supports: GitHub, GitLab, Gitea/Forgejo, or Sveltia CMS Additions.
  • Node.js 22.23.4 or later.

Where next

  • Getting started takes a site from nothing to its first visually edited page.
  • Blocks explains how to describe a block and mark up its component.
  • Integration options lists the optional parts: a design-token editor, CMS styling, your own CMS modules.

The source is on GitHub under the MIT licence.