Instantly share code, notes, and snippets.

@parkji /Gruntfile.js
Last active Dec 20, 2015

Embed
What would you like to do?
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