Skip to content

Data collections

A data collection holds entries that aren’t pages, such as the authors or categories your posts reference. In your content.config.ts, it’s a collection loaded with file(), such as file('src/data/authors.json'), or with a glob() of JSON or YAML files.

Each data collection gets its own button at the top of the dashboard. Choose it to see its entries:

  • Search the list on the left, and choose an entry to edit it in the form on the right. The form’s fields come from your collection’s schema, or from the fields your entries already have when your site hasn’t run astro sync.
  • Click Save to write your changes. Zeku doesn’t save as you type, because a half-typed value in a data file breaks every page that reads it.
  • For a collection loaded from one file, New entry adds an entry with the id you give it, and Delete removes the entry you have open.

Zeku keeps your files the way you wrote them. In YAML, your comments, quoting, indentation, and the lines you didn’t change stay as they were. Fields you didn’t edit are written back exactly as they were, and Zeku reads the file again just before saving, so a change made elsewhere in the meantime isn’t lost. In JSON, only the values you changed are rewritten, so an array kept on one line or an entry written on one line stays that way.

References to data entries get suggestions and checks in the frontmatter. See Reference fields.