Skip to content

Commit

Permalink
Basic stub out of functioning tasks, still decidedly v0.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ajpiano committed Jul 11, 2012
1 parent 3648570 commit d9dc8fa
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 0 deletions.
22 changes: 22 additions & 0 deletions LICENSE-MIT
@@ -0,0 +1,22 @@
Copyright (c) 2012 adam j. sontag

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
40 changes: 40 additions & 0 deletions grunt.js
@@ -0,0 +1,40 @@
module.exports = function(grunt) {

// Project configuration.
grunt.initConfig({
test: {
files: ['test/**/*.js']
},
lint: {
files: ['grunt.js', 'tasks/**/*.js', 'test/**/*.js']
},
watch: {
files: '<config:lint.files>',
tasks: 'default'
},
jshint: {
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
node: true,
es5: true
},
globals: {}
}
});

// Load local tasks.
grunt.loadTasks('tasks');

// Default task.
grunt.registerTask('default', 'lint');

};
34 changes: 34 additions & 0 deletions package.json
@@ -0,0 +1,34 @@
{
"author": "adam j. sontag <ajpiano@ajpiano.com> (http://ajpiano.com)",
"name": "grunt-wintersmith",
"description": "A grunt task and helpers for invoking the Wintersmith static site generator",
"version": "0.0.0",
"homepage": "https://github.com/ajpiano/grunt-wintersmith",
"repository": {
"type": "git",
"url": "git://github.com/ajpiano/grunt-wintersmith.git"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/ajpiano/grunt-wintersmith/blob/master/LICENSE-MIT"
}
],
"main": "grunt.js",
"dependencies": {
"grunt": "0.3.x",
"wintersmith": "1.0.x",
"js-yaml": "1.0.x"
},
"devDependencies": {
"grunt": "~0.3.x",
"wintersmith": "1.0.x",
"js-yaml": "1.0.x"
},
"keywords": [
"gruntplugin"
],
"engines": {
"node": "*"
}
}
39 changes: 39 additions & 0 deletions tasks/wintersmith.js
@@ -0,0 +1,39 @@
module.exports = function(grunt) {

var wintersmith = require("wintersmith");

grunt.registerTask("wintersmith", "Use the wintersmith static site generator", function() {
var config = grunt.config("wintersmith"),
done = this.async();

grunt.helper("wintersmith", config, function(error) {
if ( error ) {
grunt.warn("Wintersmithing failed.");
} else {
done();
}
});
});

grunt.registerTask("wintersmith-ordered", "Use the wintersmith static site generator, respecting an order.yaml file", function(){
var config = grunt.config("wintersmith-ordered"),
done = this.async();

grunt.helper("wintersmith-tree", config, function(error, tree) {
if ( error ) {
grunt.warn("Wintersmithing failed.");
} else {
done();
}
});
});

grunt.registerHelper("wintersmith", function(options, callback) {
wintersmith( options, callback );
});

grunt.registerHelper("wintersmith-tree", function(options, callback) {
wintersmith.loadContents( options.contents, callback );
});

};

0 comments on commit d9dc8fa

Please sign in to comment.