Created
April 21, 2014 00:36
-
-
Save gjjones/11129070 to your computer and use it in GitHub Desktop.
This is a sample Gruntfile to run the basic 'jekyll build' with local server and livereload on changes. The grunt plugin can do this stuff without connect/watch, but I wanted more control over the options for other build steps.
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
module.exports = function(grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
watch: { | |
default: { | |
files: ['**/*.*', '!_site/**.*'], | |
tasks: ['jekyll'], | |
options: { | |
livereload: true | |
} | |
} | |
}, | |
connect: { | |
default: { | |
options: { | |
hostname: 'localhost', | |
port: 9000, | |
livereload: true, | |
base: './_site', | |
open: { appName: 'chrome' } | |
} | |
} | |
}, | |
jekyll: { | |
default: { | |
} | |
} | |
}); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.loadNpmTasks('grunt-contrib-connect'); | |
grunt.loadNpmTasks('grunt-jekyll'); | |
grunt.registerTask('build', ['jekyll']); | |
grunt.registerTask('default', ['jekyll', 'connect', 'watch']); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment