Skip to content

Instantly share code, notes, and snippets.

@leafo
Created April 29, 2014 04:12
Show Gist options
  • Save leafo/11390484 to your computer and use it in GitHub Desktop.
Save leafo/11390484 to your computer and use it in GitHub Desktop.
grunt assemble test
module.exports = function(grunt) {
var pages = grunt.file.readJSON("data/pages.json");
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
assemble: {
options: {
layout: "templates/layout.hbs",
dad: "hello world",
},
pages: {
options: {
plugins: ["plugins/test.js"],
},
files: {
"some_page.html": "templates/some_page.hbs",
"some_page2.html": "templates/some_page.hbs",
}
}
}
});
grunt.loadNpmTasks("assemble");
};
var handle = function(data, next) {
console.log("HELLO FROM PLUGIN " + data.context.basename);
// console.dir(data.context);
data.context.dad = "hello world, " + data.context.pagename;
next();
};
module.exports = handle
This is some page!
<button>Hello</button>
here is dad: {{ dad }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment