A schema describes multiple types. Every type contains fields and in many instances can be thought of as describing all of the data on a page.
schema('My schema', {
TypeA, TypeB, TypeC
})
The example below can be found in the configuration file after running the alinea init command. It has the following settings:
...MediaSchema: include types needed for file uploads
type('Page', {...}): a type with two fields: title and path. After the fields a Welcome component is displayed in the dashboard. JSX can be used anywhere inside the type configuration the create custom views.
configure({isContainer: true}): mark the Page type as a container, which means it can contain sub pages
schema({
...MediaSchema,
Page: type('Page',
{
title: text('Title'),
path: path('Path')
},
<Welcome />
).configure({isContainer: true})
})