Skip to content

Instantly share code, notes, and snippets.

@parkji
Last active December 20, 2015 22:59
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save parkji/6209581 to your computer and use it in GitHub Desktop.
Save parkji/6209581 to your computer and use it in GitHub Desktop.
Grunt file for building and serving jekyll sites. Means you can just do grunt watch instead of running two Jekyll commands
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
shell: {
jekyllBuild: {
command: 'jekyll build'
},
jekyllServe: {
command: 'jekyll serve'
}
},
watch: {
files: [
'_includes/*.html',
'_layouts/*.html',
'_posts/*.markdown',
'_config.yml',
'index.html'
],
tasks: ['shell:jekyllBuild', 'shell:jekyllServe'],
options: {
interrupt: true,
atBegin: true,
livereload: true
}
}
});
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['shell']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment