Skip to content

Instantly share code, notes, and snippets.

@bradfrost
Created January 11, 2015 21:41
Show Gist options
  • Save bradfrost/0b8a5d082bde9fae5663 to your computer and use it in GitHub Desktop.
Save bradfrost/0b8a5d082bde9fae5663 to your computer and use it in GitHub Desktop.
Jekyll Grunt Cluster
module.exports = function(grunt) {
// Configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dist: {
options: {
style: 'compressed'
},
files: {
'css/style.css': '_sass/_style.scss'
}
}
},
autoprefixer: {
single_file: {
src: 'css/style.css',
dest: 'css/style.css'
}
},
shell: {
jekyllServe: {
command: "jekyll serve --baseurl="
},
jekyllBuild: {
command: "jekyll build --config _config.yml"
}
},
watch: {
css: {
files: ['_sass/*.scss', '_sass/**/*.scss'],
tasks: ['sass', 'autoprefixer', 'shell:jekyllBuild'],
options: {
livereload: {
port: 3000
}
}
}
}
});
// Plugins
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-serve');
// Tasks
grunt.registerTask('serve', ['watch', 'shell:jekyllServe']);
grunt.registerTask('default', ['sass', 'watch', 'autoprefixer', 'shell:jekyllBuild']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment