Skip to content

💾 Convert markdown files from Netlify CMS to a json database.

Notifications You must be signed in to change notification settings

whatthefoo/netlify-db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

💾 Convert markdown files from Netlify CMS to a json database.

Resources

Stars

Watchers

Forks

Packages

No packages published