Skip to content

Instantly share code, notes, and snippets.

@jonschlinkert
Created April 13, 2014 18:54
Show Gist options
  • Save jonschlinkert/10597130 to your computer and use it in GitHub Desktop.
Save jonschlinkert/10597130 to your computer and use it in GitHub Desktop.
// Define a config object to load data (for templates etc)
var config = [
// load data to the root object
['components/*.json'],
// load data to the `pkg` object
{name: 'pkg', src: 'package.json'},
// load data to the `site` object
{name: 'site', src: '.assemblerc.yml'},
// load data to an object named after the basename of each file
// e.g. foo.json is loaded to `{foo: {// data}}`
{name: ':basename', src: ['data/*.{json,yml}']},
// Load data from src to `{a: {b: {c: {// data}}}`
{dothash: true, name: 'a.b.c', src: ['*.json']}
];
// Load in config data.
var data = plasma.load(config);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment