Skip to content

Instantly share code, notes, and snippets.

@DinisCruz
Created March 28, 2017 08:55
Show Gist options
  • Save DinisCruz/52b37ca0cb54584f4791e00edfccdd30 to your computer and use it in GitHub Desktop.
Save DinisCruz/52b37ca0cb54584f4791e00edfccdd30 to your computer and use it in GitHub Desktop.
Simple gulp file to serve and watch Jekyll pages
browserSync = require('browser-sync').create();
gulp = require('gulp');
shell = require('gulp-shell');
gulp.task 'build', shell.task(['jekyll build --incremental'])
gulp.task 'reload-page', ['build'], -> browserSync.reload()
gulp.task 'default' , ['build'],->
browserSync.init
port : 9000 # site will be available at http://localhost:9000/
open : false # use to not open a new browser window every time we start gulp
logConnections : true
logLevel : 'debug'
startPath : '/new/about.html' # first page that loads up
server : baseDir: '_site/'
gulp.watch 'new/**/*.md' , ['reload-page']
gulp.watch 'website/**/*.*' , ['reload-page']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment