The config file

All configuration can be managed from the alinea.config.tsx file. This file is created during alinea init. It contains an example workspace to get started from.

If you prefer plain Javascript over Typescript, just rename the file to alinea.config.js

Example config

In the example below we find a schema which includes the default MediaSchema, necessary for file uploads, and a generic Page type. One workspace named main is defined with the following settings:

  • source: content is stored in json files and can be found in the content directory

  • mediaDir: uploaded files are placed in the public folder

  • roots: defines two separate web roots, one for data (our welcome page in this case), and one for media (file uploads)

import {Welcome} from '@alinea/dashboard/Welcome'
import {IcRoundInsertDriveFile} from '@alinea/ui/icons/IcRoundInsertDriveFile'
import {IcRoundPermMedia} from '@alinea/ui/icons/IcRoundPermMedia'
import {alinea} from 'alinea'

export const config = alinea.createConfig({
  schema: alinea.schema({
    Page: alinea.type(
        title: alinea.text('Title'),
        path: alinea.path('Path')
      <Welcome />
  workspaces: {
    main: alinea.workspace('Example', {
      source: './content',
      mediaDir: './public',
      roots: {
        data: alinea.root('Example project', {
          icon: IcRoundInsertDriveFile,
          contains: ['Page']
        media: alinea.root('Media', {
          icon: IcRoundPermMedia,
          contains: ['MediaLibrary']