Overview
Learn about how Contentful Sync works.
What it does?
- Keeps Contentful Content Types up-to-date and uses Contentful's CMS as the source of truth
- Converts all files in a specific directory (
web/schemas/contentful/) including at least 2 levels of subdirectories so you are free to organize them as you wish - It supports Javascript and Typescript schema files
- Exposes all API functions so you can reuse/import any function of this API
- Ignores files that start with a
.,_, and all non-javascript files - Only uploads the most recent changes to contentful
- Saves new conponents and changes as a draft or can publish in the CMS
What it does not do
- Delete files in Contentful
How to use it
- Run
yarn syncContentful - Thats it!!!
RULES to follow!
- All schema file names must be unique inside the "contentfulSchemaFolder", even when they are in different subdirectories
- Only one person should update the same component at a time
Configuration
Ignore this section if the project is already setup.
- Configure any variables you want in the "CONFIGURE CONTENTFUL API" section found in
web/schemas/contentfulConfig.js - Create a file called
_schema.jsinweb/schemas/contentful - Run the export function called "run" during the build process and thats it!!!