This is a fairly complete assemblefile
Shows how to:
- load templates
- use tasks with plugins
- use middleware
- register helpers
var assemble = require('assemble');
var htmlmin = require('gulp-htmlmin');
var minifycss = require('gulp-minify-css');
var less = require('gulp-less');
// load templates to be used in any or all of the tasks defined below
assemble.partials('templates/partials/*.hbs');
assemble.layouts('templates/layouts/*.hbs');
assemble.task('html', function() {
assemble.src('templates/*.hbs')
// `htmlmin` is a plugin that will minify html after templates are rendered
.pipe(htmlmin())
.pipe(assemble.dest('_gh_pages'));
});
assemble.task('css', function() {
assemble.src('styles/*.less')
// pre-process less
.pipe(less())
// minify css
.pipe(minifycss())
.pipe(assemble.dest('_gh_pages/assets/css'));
});
// running `assemble` in the command line will execute both the html and css tasks
assemble.task('default', ['html', 'css']);