blob: b46b1ac0e0513f8189924c46790ba38eedfd914c [file] [log] [blame]
bigbiff bigbiffeb409502016-12-10 13:13:16 -05001var gulp = require('gulp');
2var autoprefixer = require('gulp-autoprefixer');
3var minifyCSS = require('gulp-minify-css');
4var notify = require('gulp-notify');
5var gutil = require('gulp-util');
6var cp = require('child_process');
7var path = require('path');
8var uglify = require('gulp-uglify');
9var jsonminify = require('gulp-jsonminify');
bigbiffd006b302015-03-06 18:36:03 -050010
11
bigbiff bigbiffeb409502016-12-10 13:13:16 -050012var messages = {
13 jekyllBuild: '<span style="color: grey">Running:</span> $ jekyll build'
14};
bigbiffd006b302015-03-06 18:36:03 -050015
bigbiff bigbiffeb409502016-12-10 13:13:16 -050016/**
17 * Build the Jekyll Site
18 */
19gulp.task('jekyll-build', function (done) {
20 browserSync.notify(messages.jekyllBuild);
21 return cp.spawn('jekyll', ['build'], {stdio: 'inherit'})
22 .on('close', done);
bigbiffd006b302015-03-06 18:36:03 -050023});
24
bigbiff bigbiffeb409502016-12-10 13:13:16 -050025// minifiy js
26gulp.task('js', function() {
27 gulp.src('_site/js/*.js')
28 .pipe(uglify())
29 .pipe(gulp.dest('dist/js/'))
bigbiffd006b302015-03-06 18:36:03 -050030});
31
bigbiff bigbiffeb409502016-12-10 13:13:16 -050032gulp.task('json', function() {
33 gulp.src('_site/*.json')
34 .pipe(jsonminify())
35 .pipe(gulp.dest('dist/'))
bigbiffd006b302015-03-06 18:36:03 -050036});
bigbiff bigbiffeb409502016-12-10 13:13:16 -050037
38gulp.task('cp1', function() {
39 gulp.src('dist/js/*.js')
40 .pipe(gulp.dest('_site/js/'))
41});
42
43gulp.task('cp2', function() {
44 gulp.src('dist/search.json')
45 .pipe(gulp.dest('_site/'))
46});
47
48gulp.task('default', ['js', 'json', 'cp1', 'cp2']);