static-cms/website/site/content/docs/editorial-workflow.md
Jessica Parsons 155f40e5e4
Migrate netlify-cms-www site into this repo (#860)
* Add frontmatter to docs files (prep to move)

* Move docs into position for website migration

* Migrate website from netlify-cms-www

Some modifications, including most of the changes in https://github.com/netlify/netlify-cms-www/pull/58 (previously reverted).

Also updated the readme and added hugo-bin for quicker onboarding of new docs contributors.

* Remove netlify.toml

This allows separate build commands for cms-demo and netlifycms.org.

* Remove website/netlify.toml

May re-add later, but it's not doing anything for now.

* Remove unused content file
2017-12-04 16:42:20 -08:00

1.9 KiB
Executable File

title position
Editorial Workflow 40

Editorial Workflow

Overview

By default, all entries created or edited in the Netlify CMS are committed directly into the main repository branch.

Alternatively, you can enable an optional "Editorial Workflow" mode that allows for more control over the content publishing phases. All unpublished entries will be arranged in a board according to their status, and they can be further reviewed and edited before going live.

Editorial workflow

From a technical perspective, the workflow translates editor UI actions into common Git commands:

Actions in Netlify UI ... Perform these Git actions
Save draft Commits to a new branch, and opens a pull request
Edit draft Pushes another commit to the draft branch/pull request
Approve and publish draft Merges pull request and deletes branch

Adding to your site

To enable the editorial workflow, add this line to your admin/config.yml file:

publish_mode: editorial_workflow

There are no other configuration options right now. There are always three possible statuses, and new branch names are created according to the pattern cms/collectionName-entrySlug.

About metadata

Netlify CMS embraces the idea of Git-as-backend for storing metadata. The first time it runs with the editorial_workflow setup, it creates a new ref called meta/_netlify_cms, pointing to an empty, orphan tree.

Actual data are stored in individual json files committed to this tree.

Implementation

Instead of adding logic to CollectionPage and EntryPage, the Editorial Workflow is implemented as Higher Order Components, adding UI and dispatching additional actions.

Furthermore, all editorial workflow state is managed in Redux - there's an actions/editorialWorkflow.js file and a reducers/editorialWorkflow.js file.