Skip to content
This repository has been archived by the owner on Apr 24, 2019. It is now read-only.

Commit

Permalink
Add grunt-generator to INIT and default config
Browse files Browse the repository at this point in the history
This is a WIP implementation and might not yet work as
expected. Please test, add configuration details while
still in the feature branch.

Targets #123.
  • Loading branch information
anselmh committed Jan 15, 2015
1 parent 5850784 commit e67cd4c
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ module.exports = function (grunt) {
'copy',
'replace:htaccess',
'requirejs',
'pages:dev'
'pages:dev',
'generator:dev'
]);

// Default task
Expand Down
15 changes: 15 additions & 0 deletions grunt/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,20 @@ module.exports = {
modernizr: '../node_modules/grunt-modernizr/lib/modernizr-dev.js',
mainjs: '<script data-main="js/config" src="../node_modules/requirejs/require.js"></script>'
}
},

// Static Site Generator
generator: {
files: {
cwd: 'src/pages',
src: '**/*',
dest: 'dist/',
ext: '.html'
},
options: {
partialsglob: 'pages/partials/*.html',
templates: 'templates',
environment: 'dev'
}
}
};
22 changes: 22 additions & 0 deletions grunt/options/generator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Static Site Generator
*/
'use strict';

var config = require('../config');

module.exports = {
dev: {
files: [{
cwd: config.generator.files.cwd,
src: config.generator.files.src,
dest: config.generator.files.dest,
ext: config.generator.files.ext
}],
options: {
partialsglob: config.generator.options.partialsglob,
templates: config.generator.options.templates,
environment: config.generator.options.environment
}
},
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"grunt-contrib-jshint": "0.10.0",
"grunt-contrib-requirejs": "0.4.4",
"grunt-contrib-watch": "0.6.1",
"grunt-generator": "^0.4.0",
"grunt-karma": "0.9.0",
"grunt-modernizr": "0.6.0",
"grunt-pleeease": "^1.2.0",
Expand Down

0 comments on commit e67cd4c

Please sign in to comment.