-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
44 lines (37 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
42
43
44
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var markdown = require('gulp-markdown');
var reveal = require('gulp-reveal');
var sass = require('gulp-sass');
gulp.task('browser-sync', function() {
browserSync.init({
server: {
baseDir: "./"
}
});
});
gulp.task('default', function () {
gulp.src('index.md')
.pipe(markdown())
.pipe(reveal())
.pipe(gulp.dest('.'));
});
gulp.task('watch', ['browser-sync', 'sass'], function () {
gulp.watch('**/*.md', ['default', 'reload']);
});
gulp.task('sass', function () {
return gulp.src('css/theme/source/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./css/theme'));
});
gulp.task('sass-reveal', function () {
return gulp.src('css/reveal.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./css'));
});
gulp.task('reload', ['sass', 'sass-reveal'], function() {
browserSync.reload();
});
gulp.task('sass:watch', function () {
gulp.watch(['css/theme/source/*.scss', 'css/reveal.scss'], ['sass', 'sass-reveal', 'reload']);
});