Skip to content

Latest commit

 

History

History
55 lines (35 loc) · 1.35 KB

README.md

File metadata and controls

55 lines (35 loc) · 1.35 KB

Netlify DB

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.

Installation

Firstly, install the package using Yarn or NPM

yarn add netlify-db --dev

or

npm install --save-dev netlify-db

Usage

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! 🎉

Options

-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

Author

Leif Riksheim (@leifriksheim) - WTFoo