Use your favorite framework with Netlify CMS.
netlify-db
will parse markdown files generated by Netlify CMS, and create a single json file you can use as your database. Get the performance benefits of a static page generator, while still using your favorite front-end setup.
Firstly, install the package using Yarn or NPM
yarn add netlify-db --dev
or
npm install --save-dev netlify-db
Once that's done, you can run this command inside your project's directory:
netlify-db create <admin folder> <database folder>
Example:
netlify-db create public/admin src
You should run this before your build script so Netlify can create a fresh json file for each change.
"scripts": {
"build": "npm run build:db && npm run build:app",
"build:db": "netlify-db create public/admin src",
"build:app": "your-build-script"
}
That's it! 🎉
-w
--watch
to watch markdown files and write to the database. Useful when developing and pulling new changes, or if you want to see changes when editing the markdown.
-n
--name
name for the database. ex: --name my-database
Leif Riksheim (@leifriksheim) - WTFoo