netlify-cms-backend-fs0.4.4 • Public • Published
Custom Backend for NetlifyCMS
- This library is still in beta!
- Version 0.4.0 is a breaking change 🐉.
- Version 0.4.0+ is only compatible with builds of
- This is a backend library for NetlifyCMS proposed for file system testing locally during development.
- Handy for testing your config files.
To load dependencies for build
yarn add netlify-cms-backend-fs --dev
npm install netlify-cms-backend-fs --save-dev
Parts of this package
Backend library bundles exist in
dist/index.jscan be used for global access to
FileSystemBackendClassand is a
umdbuild to use directly as a component see example in
netlify-cms-starterin this monorepo.
Express server middleware is in the
dist/fs/index.js(not bundled) has the node script to be used as middleware for webpack devServer or express server to create the api for development.
How to register with CMS on a static page locally
- Copy the package
dist/index.jsscript bundle file into your cms location (maybe
- Change the
index.htmlpage to use the backend as in the example below
- Register the backend Class to the CMS as shown below
- Change the
backend: file-systemor the name you registered
- [Webpack] Add devServer middleware to expose the
/apipath for the file-system API
- [Stand Alone Server] Create an express server (example coming soon) to host the
Add script and register in your CMS page
NOTE: v4.x of this library will not work without a current version of
netlify-cms-app (see notes at the top of this document).
NetlifyCMS<!-- Include the script that builds the page and powers Netlify CMS -->
Start your devServer using the middleware scripts
- see the netlify-cms-starter for a create-react-app example in this monorepo.
- see ADARTA/netlify-cms-react-example for a full create-react-app example.
- see ADARTA/gatsby-starter-netlify-cms for a Gatsby use case example (WIP).
This library requires you to be using NetlifyCMS v2.9.x or above (see notes at the top).
Recommendation: If you are looking to extend NetlifyCMS and run a local file-system setup for development, use the netlify-cms-react-example starter project. It implements the backend as a component and bundles to a custom CMS deployment for your project.
WARNING: This is a development tool. It can safely be used in a repository locally, since it is not used in production code. Commit and push changes before you start using.
Don't forget: code like you're on 🔥
The Netlify Logo is Copyright of Netlify and should not be used without their consent.