-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgulpfile.js
More file actions
30 lines (25 loc) · 802 Bytes
/
gulpfile.js
File metadata and controls
30 lines (25 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var gulp = require('gulp');
var browserSync = require('browser-sync');
var cp = require('child_process');
gulp.task('jekyll-build', function (done) {
browserSync.notify("Running jekyll build");
return cp.spawn('jekyll', ['build'], {stdio: 'inherit'})
.on('close', done);
});
gulp.task('jekyll-build-reload', gulp.series('jekyll-build', function (done) {
browserSync.reload();
done();
}));
gulp.task('browser-sync', gulp.series('jekyll-build-reload', function(done) {
browserSync({
server: {
baseDir: '_site'
}
});
done();
}));
gulp.task('watch', function (done) {
gulp.watch(['**/*', '!_site/**/*'], gulp.series('jekyll-build-reload'));
done();
});
gulp.task('default', gulp.series('browser-sync', 'watch'));