-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gulpfile.js
35 lines (30 loc) · 972 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
var gulp = require('gulp');
var ghPages = require('gulp-gh-pages');
var markdown = require('gulp-markdown');
var rename = require("gulp-rename");
var htmlreplace = require('gulp-html-replace');
gulp.task('markdown', function () {
return gulp.src('README.md')
.pipe(rename("index.md"))
.pipe(markdown())
.pipe(gulp.dest('examples'));
});
gulp.task('copy-minitracker', function () {
return gulp.src('build/minitracker.js')
.pipe(gulp.dest('dist'));
});
gulp.task('copy-examples', function () {
return gulp.src('examples/**/*')
.pipe(gulp.dest('dist'));
});
gulp.task('build', ['copy-examples', 'copy-minitracker', 'markdown'], function () {
return gulp.src('examples/**/*.html')
.pipe(htmlreplace({
'minitracker': '../minitracker.js'
}))
.pipe(gulp.dest('dist'));
});
gulp.task('deploy', ['build'], function() {
return gulp.src('./dist/**/*')
.pipe(ghPages());
});