mirror of
https://github.com/Xevion/old.xevion.github.io.git
synced 2025-12-06 03:15:39 -06:00
clean up gulpfile
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
|
||||
80
gulpfile.js
80
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 );
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user