0.6.5 • Published 8 years ago

metalsmith-firebase v0.6.5

Weekly downloads
-
License
MIT
Repository
-
Last release
8 years ago

metalsmith-firebase npm Travis Codecov

Load firebase data into metalsmith.

Installation

$ npm install metalsmith-firebase --save

Usage

CLI

Add metalsmith-firebase to your metalsmith.json plugins and specify your firebase options:

{
  "plugins": {
    "metalsmith-firebase": {
      "url": "https://myfirebase.firebaseio.com",
      "options": {
        "collections": [
          "pages",
          "posts"
        ]
      }
    }
  }
}

JS

Pass options to the firebase plugin and pass it to Metalsmith with the use method:

import firebase from 'metalsmith-firebase';

metalsmith.use(firebase({
  url: 'https://myfirebase.firebaseio.com',
  options: {
    collections: [
      "pages",
      "posts"
    ]
  }
}));

You can specify options to merge data into files. By including "collections", you can specify the references that will be used to create pages from a _key property. For example, if I have _key: posts/2016-09-05-metalsmith-firebase, a file will be created with that _key, the property will be removed, and all the data will be assigned to that object, including contents which will be transformed to a buffer for other metalsmith plugins.

Access the data on the firebase object within the template file.

License

MIT

0.6.5

8 years ago

0.6.4

8 years ago

0.6.3

8 years ago

0.6.2

8 years ago

0.6.1

8 years ago

0.6.0

8 years ago

0.5.0

8 years ago

0.4.0

8 years ago

0.3.3

8 years ago

0.3.2

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago