From 634483095765444d4a2e2ae421b6be6aa086b19a Mon Sep 17 00:00:00 2001 From: Brittany Chiang Date: Wed, 15 Mar 2017 13:59:59 -0400 Subject: [PATCH] clean up gulpfile --- build/browsersync.js | 4 +-- gulpfile.js | 80 +------------------------------------------- 2 files changed, 3 insertions(+), 81 deletions(-) diff --git a/build/browsersync.js b/build/browsersync.js index 27574d8..b96c951 100644 --- a/build/browsersync.js +++ b/build/browsersync.js @@ -9,9 +9,9 @@ const templatePath = [ '**/*.html', '**/*.yml', '_posts/*', '_drafts/*']; module.exports = gulp => { - // Build the Jekyll Site + // run `jekyll build` gulp.task('jekyll-build', done => { - return cp.spawn( jekyll , ['build', '--drafts', '--config', '_config.yml'], {stdio: 'inherit'}) + return cp.spawn( jekyll , ['build'], {stdio: 'inherit'}) .on('close', done); }); diff --git a/gulpfile.js b/gulpfile.js index 470d798..f5ecdfa 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,90 +1,12 @@ 'use strict'; -const gulp = require('gulp'); -// const browserSync = require('browser-sync'); -// const cp = require('child_process'); -// const sass = require('gulp-sass'); -// const prefix = require('gulp-autoprefixer'); -// const cleanCSS = require('gulp-clean-css'); -// const jshint = require('gulp-jshint'); -// const babel = require('gulp-babel'); -// const uglify = require('gulp-uglify'); -// const imagemin = require('gulp-imagemin'); - +const gulp = require('gulp'); const sass = require('./build/sass'); const scripts = require('./build/scripts'); const images = require('./build/images'); const fonts = require('./build/fonts'); const sync = require('./build/browsersync'); -// const jekyll = process.platform === 'win32' ? 'jekyll.bat' : 'jekyll'; - -// // Build the Jekyll Site -// gulp.task('jekyll-build', done => { -// return cp.spawn( jekyll , ['build', '--drafts', '--config', '_config.yml'], {stdio: 'inherit'}) -// .on('close', done); -// }); - -// // Rebuild Jekyll & reload the page -// gulp.task('jekyll-rebuild', ['jekyll-build'], () => { -// browserSync.reload(); -// }); - -// // Wait for jekyll-build task to complete, then launch the Server -// gulp.task('browser-sync', ['sass', 'scripts', 'jekyll-build'], () => { -// browserSync({ -// server: { -// baseDir: '_site' -// } -// }); -// }); - -// const scssPath = ['_scss/**/*.scss','_scss/*.scss']; -// const jsPath = ['_scripts/*.js']; -// const templatePath = ['index.html', '404.html', '_layouts/*.html', '_includes/*.html', '_data/*.yml', '_posts/*', '_drafts/*', '**/*.html']; - -// gulp.task('watch', () => { -// gulp.watch(scssPath, ['sass', 'jekyll-rebuild']); -// gulp.watch(jsPath, ['scripts', 'jekyll-rebuild']); -// gulp.watch(templatePath, ['jekyll-rebuild']); -// }); - -// gulp.task('styles', () => { -// return gulp.src('_scss/*.scss') -// .pipe(sass({ -// includePaths: ['scss'], -// onError: browserSync.notify -// })) -// .pipe(prefix(['last 15 versions', '> 1%', 'ie 8', 'ie 7'], {cascade: true})) -// .pipe(cleanCSS({compatibility: 'ie8'})) -// .pipe(gulp.dest('_site/css')) -// .pipe(gulp.dest('css')); -// }); - -// gulp.task('scripts', () => { -// return gulp.src('_scripts/*.js') -// .pipe(jshint()) -// .pipe(babel({ -// presets: ['es2015'] -// })) -// .pipe(uglify()) -// .pipe(gulp.dest('_site/js')) -// .pipe(gulp.dest('js')); -// }); - -// gulp.task('images', () => { -// return gulp.src('img/**/*.+(png|jpg|gif|svg)') -// .pipe(imagemin()) -// .pipe(gulp.dest('_site/img')); -// }); - -// gulp.task('fonts', () => { -// return gulp.src('fonts/**/*') -// .pipe(gulp.dest('_site/fonts')); -// }); - -// gulp.task('serve', ['browser-sync', 'watch']); - [ sass, scripts, images, fonts, sync ].forEach( task => { task( gulp ); });