ExtensionEngine / tailor

Content authoring platform
MIT License
31 stars 10 forks source link

Tailor CMS

CircleCI build
status Codacy Badge Known
Vulnerabilities GitHub package
version GitHub
license js @extensionengine
style style @extensionengine
style Open Source
Love

Configurable headless CMS for complex content structures.

Dependencies

Installation

Prerequisites

Setup

Launch

Development

This project uses a monorepo setup. In order to contribute to packages following commands should be executed:

Production

Content repository structure

Repository structure can be altered using tailor configuration file, which must be placed inside the root directory and named tailor.config.js.

Use the tailor.config.js.example file as a template:

$ cp tailor.config.js.example tailor.config.js

and enter the configuration details. At the current time, it is not possible to override the filename or location of the configuration file.

Content repository structures are defined using the following properties:

SCHEMAS

An array of Schema objects.

Schema

ActivityConfig - Schema structure elements

Configuration for schema structure nodes (activities). Contains the following properties:

ActivityRelationship

Defines the structure of the activity relationship field.

Metadata

Defines the structure of the activity metadata field.

MetadataValidator

Defines validation rules on an activity metadata field.

CONTENT_CONTAINERS

An array of ContentContainer objects.

ContentContainer

Configuration for content containers. Contains the following properties:

ElementMetaConfig

Defines the structure of an content element metadata.

ElementRelationship

Defines the structure of an content element relationship field.

ElementMeta

Defines what meta fields content element has.

PREVIEW_URL

A string template that will be interpolated on the client using two route params, repositoryId and activityId, into a preview URL for each activity. Example: https://my.url.com/#/repository/{repositoryId}/activity/{activityId}/preview

Workflows

For each schema, workflow can be defined to enable users to track and assign activities which are flagged for tracking. Each workflow is defined by a set of statuses that the activity can have. Workflows are assigned to schemas through schema's workflowId option in tailor configuration file.

Workflows are configured with the following options in the tailor configuration file:

WORKFLOWS

An array of Workflow objects.

Workflow

Defines activity statuses for repository workflow. Workflow can be reused across multiple schemas by assigning the same workflow ID to schema's workflowId option.

ActivityStatus

EXTENSIONS

Tailor supports creation of custom content elements and custom containers. These extensions can have unique content and structure that the default content elements and containers do not support. The template for creating custom content elements can be found here while the template for creating custom containers can be found here.

Installing extensions

  1. copy (or git clone) extension files in extensions/content-<elements or containers>/<my-extension-name>
  2. create index.js file in extensions/content-<elements or containers> directory
  3. in the file from the previous step add
    module.exports = ['my-extension-name'];

Note that module.exports is an array and you can add as many extensions and just include their folder names in this array to include all of them. After installation, the extension is ready for use and should be listed in tailor.config.js file.