metalsmith-metadata

A metalsmith plugin to load global metadata from files.

metalsmith-metadata

A metalsmith plugin to load global metadata from files.

Supports .json and .yaml data.

$ npm install metalsmith-metadata

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"
    }
  }
}

Pass the options to Metalsmith#use:

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

MIT