-
Notifications
You must be signed in to change notification settings - Fork 9
/
gulpfile.js
41 lines (35 loc) · 1.1 KB
/
gulpfile.js
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
31
32
33
34
35
36
37
38
39
40
41
// instanciando módulos
var gulp = require('gulp');
var watch = require('gulp-watch');
var del = require('del');
var shell = require('gulp-shell');
var connect = require('gulp-connect-multi')();
gulp.task('run:pelican', shell.task([
'pelican content -s pelicanconf.py'
]));
gulp.task('clean:pelican', function () {
return del([
'output/*'
]);
});
gulp.task('connect', connect.server({
root: ['output'],
port: 1337,
livereload: true,
open: {
browser: 'chrome' // if not working OS X browser: 'Google Chrome'
}
}));
gulp.task('reload:output', function () {
connect.reload();
});
gulp.task('watch', function(){
gulp.watch('*', ['run:pelican', 'reload:output']);
gulp.watch('content/*', ['run:pelican', 'reload:output']);
gulp.watch('content/*/*', ['run:pelican', 'reload:output']);
gulp.watch('content/*/*/*', ['run:pelican', 'reload:output']);
gulp.watch('theme/*', ['run:pelican', 'reload:output']);
gulp.watch('theme/*/*', ['run:pelican', 'reload:output']);
gulp.watch('theme/*/*/*', ['run:pelican', 'reload:output']);
})
gulp.task('serve', ['connect', 'run:pelican', 'watch']);