Skip to content

Instantly share code, notes, and snippets.

Created August 2, 2014 12:13
Show Gist options
  • Save anonymous/96d03c316f5bd6d51878 to your computer and use it in GitHub Desktop.
Save anonymous/96d03c316f5bd6d51878 to your computer and use it in GitHub Desktop.
'use strict';
var gulp = require('gulp');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
var exec = require('child_process').exec;
var run = function(command, done) {
exec(command, function(error) {
if (error) {
return done(error);
};
done();
});
};
gulp.task('compass', function(done) {
// A `config.rb` file must be present in the same directory of this file.
run('bundle exec compass compile .', done);
});
gulp.task('jekyll', ['compass'], function(done) {
// Compile Jekyll into `dist`. This task executes the `compass` task each time,
// it could be optimized to only execute it if SASS files are changed.
run('bundle exec jekyll build', done);
});
gulp.task('serve', function() {
browserSync({
notify: false,
server: {
baseDir: ['dist']
}
});
gulp.watch(['src/**/*'], ['jekyll', reload]);
});
gulp.task('development', ['serve']);
gulp.task('default', ['jekyll']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment