Last active
July 9, 2016 19:37
-
-
Save iansinnott/a9175e41f521a56eae52 to your computer and use it in GitHub Desktop.
A gulpfile for working with Jekyll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// gulpfile.js | |
var gulp = require('gulp'), | |
gutil = require('gulp-util'), | |
sass = require('gulp-sass'), | |
autoprefixer = require('gulp-autoprefixer'), | |
minifycss = require('gulp-minify-css'), | |
rename = require('gulp-rename'), | |
shell = require('gulp-shell'), | |
livereload = require('gulp-livereload'), | |
lr = require('tiny-lr'), | |
server = lr(); | |
gulp.task('sass', function() { | |
return gulp.src('sass/style.scss') | |
.pipe(sass()) | |
.pipe(autoprefixer( 'last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4' )) | |
.pipe(minifycss()) | |
.pipe(rename('style.min.css')) | |
.pipe(gulp.dest('public/css')) | |
.pipe(gulp.dest('_site/public/css')) | |
.pipe(livereload(server)); | |
}); | |
gulp.task('build', shell.task([ 'jekyll build' ])); | |
gulp.task('watch', function() { | |
server.listen(35729, function(err) { | |
if (err) | |
return console.log(err); | |
gulp.watch('sass/**/*.scss', ['sass']); | |
gulp.watch([ | |
'_includes/**/*.html', | |
'_layouts/**/*.html', | |
'_posts/**/*' | |
], ['build']); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I can't find tiny-lr :/