Schema

A schema is a collection of Types.

import {Config} from 'alinea'

Config.schema({
  types: {
    TypeA, TypeB, TypeC
  }
})

Configuration

Your Schema should be defined in the CMS config. There are currently no configuration options for it.

Example schema

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.

import {Config, Field} from 'alinea'

Config.schema({
  types: {
    BlogOverview: Config.document('Blog overview', {
      contains: ['BlogPost']
    }),
    BlogPost: Config.document('Blog post', {
      fields: {
        publishDate: Field.date('Publish date'),
        body: Field.richText('Body')
      }
    })
  }
})