Website/node_modules/metalsmith-metadata
2015-12-02 18:54:12 -05:00
..
lib Starting layout 2015-12-02 18:54:12 -05:00
test Starting layout 2015-12-02 18:54:12 -05:00
.npmignore Starting layout 2015-12-02 18:54:12 -05:00
History.md Starting layout 2015-12-02 18:54:12 -05:00
Makefile Starting layout 2015-12-02 18:54:12 -05:00
package.json Starting layout 2015-12-02 18:54:12 -05:00
Readme.md Starting layout 2015-12-02 18:54:12 -05:00

metalsmith-metadata

A metalsmith plugin to load global metadata from files.

Supports .json and .yaml data.

Installation

$ npm install metalsmith-metadata

CLI Usage

Install via npm and then add the metalsmith-metadata key to your metalsmith.json plugins. Each key in the dictionary of options will be the key mixed into the global metadata, like so:

{
  "plugins": {
    "metalsmith-metadata": {
      "authors": "./path/to/authors.json",
      "categories": "./path/to/categories.yaml"
    }
  }
}

Javascript Usage

Pass the options to Metalsmith#use:

var metadata = require('metalsmith-metadata');

metalsmith.use(metadata({
  authors: './path/to/authors.json',
  categories: './path/to/categories.yaml'
}));

License

MIT