Created
April 29, 2014 04:12
-
-
Save leafo/11390484 to your computer and use it in GitHub Desktop.
grunt assemble test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment