When you create a file for a collection in CloudCannon, the initial contents and file extension are copied from a schema file configured for the collection.
Follow these steps to create and configure a schema for your collection.
Here's an example schema file and the required configuration for a
Without a schema, the contents of another content file in the collection is used instead. The extension is copied as-is, and the contents are copied with some inputs cleared.
Creating a file from a schema adds a
_schema field to the front matter or data to keep track of what schema the file was created from. Schemas also keep data consistent by updating the available inputs when editing existing files so it's important that this is set correctly.
default schema is used if this field does not exist. You can change the field from
_schema with the
schema_key option when defining your collections.
Schemas are also used to manage and keep data consistent across files in a collection, as well as providing the default
add_options for creating new files.