-
Notifications
You must be signed in to change notification settings - Fork 4
/
gulpfile.js
43 lines (36 loc) · 957 Bytes
/
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
42
43
var gulp = require('gulp');
var ghPages = require('gulp-gh-pages');
var run = require('gulp-run');
var browserSync = require('browser-sync').create();
/**
* Deploy the site.
*/
gulp.task('deploy', function() {
return gulp.src('./docs/static/**/*')
.pipe(ghPages());
});
/**
* Generating the text.
*/
gulp.task('generate', function() {
return run('vendor/bin/daux --source=docs/source/ --destination=docs/static').exec();
});
/**
* Live reload for the static generate task.
*/
gulp.task('serve', ['generate'], function() {
browserSync.init({
server : './docs/static',
open: true
});
gulp.watch('./docs/source/**/*', ['generate']).on('change', function() {
function sleep (time) {
return new Promise((resolve) => setTimeout(resolve, time));
}
sleep(500).then(() => {
// Wait for a 0.2 seconds since daux take time until the files are
// generated.
browserSync.reload();
});
});
});