-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
21 lines (17 loc) · 831 Bytes
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// copied from https://nvbn.github.io/2015/06/19/jekyll-browsersync/
var gulp = require('gulp');
var shell = require('gulp-shell');
var browserSync = require('browser-sync').create();
// Task for building blog when something changed:
// gulp.task('build', shell.task(['bundle exec jekyll build --watch']));
// Or if you don't use bundle:
gulp.task('build', shell.task(['jekyll build --watch --draft']));
gulp.task('build:no-draft', shell.task(['jekyll build --watch']));
// Task for serving blog with Browsersync
gulp.task('serve', function () {
browserSync.init({server: {baseDir: '_site/'}});
// Reloads page when some of the already built files changed:
gulp.watch('_site/**/*.*').on('change', browserSync.reload);
});
gulp.task('default', ['build', 'serve']);
gulp.task('no-draft', ['build:no-draft', 'serve']);