-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgulpfile.js
More file actions
59 lines (50 loc) · 1.42 KB
/
gulpfile.js
File metadata and controls
59 lines (50 loc) · 1.42 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
var gulp = require('gulp'),
markdown = require('gulp-markdown'),
reveal = require('gulp-reveal'),
notify = require('gulp-notify'),
express = require('express'),
del = require('del'),
paths = {
target: './target/',
base: './src/',
vendor: './src/vendors/**',
markdown: './src/*.md',
template: './template.mustache',
img: './src/img/**',
html: './src/**.html'
};
gulp.task('markdown', function () {
return gulp.src(paths.markdown)
.pipe(markdown())
.pipe(reveal({template: paths.template }))
.pipe(gulp.dest(paths.target));
});
gulp.task('express', function () {
var app = express();
app.use(express.static(paths.target));
app.listen(5000);
});
gulp.task('vendor', function () {
return gulp.src(paths.vendor, {base: paths.base})
.pipe(gulp.dest(paths.target))
.pipe(notify({message: 'vendor copied'}));
});
gulp.task('html', function () {
return gulp.src(paths.html, {base: paths.base})
.pipe(gulp.dest(paths.target))
.pipe(notify({message: 'html copied'}));
});
gulp.task('img', function () {
return gulp.src(paths.img, {base: paths.base})
.pipe(gulp.dest(paths.target))
.pipe(notify({message: 'img copied'}));
});
gulp.task('clean', function (cb) {
del([
paths.target
], cb);
});
gulp.task('default', ['markdown', 'vendor', 'html', 'img']);
gulp.task('watch', ['express'], function () {
gulp.watch(paths.markdown, ['default']);
});