projmate-grunt-consolidate

Compile consolidate supported templates to HTML.

projmate-grunt-consolidate

Compiles templates using consolidate into HTML.

If you haven't used grunt before, be sure to check out the Getting Started guide.

To install this plugin

npm install projmate-grunt-consolidate --save-dev
 

You must also install any engine library, for example to use the dust engine

npm install dustjs-linkedin --save-dev

This plugin registers all consolidate engines as grunt tasks.

Run any engine like so grunt ENGINE.

Files and options should be specified according to the multi task documentation.

Version 0.4.x of this plugin is compatible with Grunt 0.4.x.

Compile all dust files in src/ to generated/ using relative paths, excluding files and directories that start with underscore character.

grunt.initConfig({
  dust: {
    // Consolidate engine options 
    options: {
      views: __dirname + 'test/fixtures',
    },
 
    compile: {
      files: [{
        expand: true,
        cwd: 'src/',
        src: ['**/*.dust'],
        dest: 'generated/',
        ext: '.html',
 
        // ignore underscored directories or files 
        filterfunction(srcFile) {
          return !/\/_/.test(srcFile);
        }
      }],
 
      // locals 
      options: {
        data: {
          title: 'My Front Page'
        }
      }
    }
  }
});