Metalsmith JSON API
Use this plugin like any other Metalsmith plugin:
var Metalsmith =api =...;...;
This will create unique ids based on the files content and create a JSON file with the name of the unique id.
The unique ids are saved in
_uid and a link to the api file is saved at
_apiURL on every file (so they can be accessed in templates).
path: The path where the json files will be saved (default to
pattern: glob pattern (array) to specify the files that should be handled by this plugin (defaults to all)
ignoreKeys: An array of keys that should be ignored from the metalsmith file object (i. e. if you are using a plugin that creates circular references)
npm test or
mocha -u tdd to run the test suite.