A schema is a collection of Types.
export const cms = createCMS({
schema: alinea.schema({
TypeA, TypeB, TypeC
})
})
Your Schema should be defined in the CMS config. There are currently no configuration options for it.
The Schema below is a minimal example of a blog setup. It holds two types: BlogOverview and BlogPost. The overview type corresponds to a page that lists the posts. To achieve that it is configured as a container which can hold blog posts as children.
alinea.schema({
BlogOverview: alinea.document('Blog overview', {
[alinea.meta]: {
isContainer: true,
contains: ['BlogPost']
}
}),
BlogPost: alinea.document('Blog post', {
publishDate: alinea.date('Publish date'),
body: alinea.richText('Body')
})
})