Created
September 2, 2013 23:48
-
-
Save dfrnswrth/6418270 to your computer and use it in GitHub Desktop.
A Grunt config for better Jekyll development.
The goal here is to enhance the Jekyll dev process, but allow falling-back to vanilla Jekyll tasks. All directories are named per Jekyll defaults.
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
# A Grunt config for Jekyll | |
# ========================= | |
# The goal here is to enhance the Jekyll dev process, but allow falling-back | |
# to vanilla Jekyll tasks. All directories are named per Jekyll defaults. | |
module.exports = (grunt) -> | |
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks) | |
# loads: | |
# grunt-contrib-clean | |
# grunt-contrib-connect | |
# grunt-contrib-copy | |
# grunt-contrib-sass | |
# grunt-contrib-watch | |
# grunt-shell | |
grunt.initConfig | |
# CLEAN | |
clean: | |
files: [ 'css' ] | |
# CONNECT | |
connect: | |
server: | |
options: | |
port: 4000 | |
base: '_site' | |
# COPY | |
copy: | |
css: | |
src: 'css/*' | |
dest: '_site/' | |
# SASS | |
sass: | |
main: | |
files: [ | |
expand: true | |
cwd: '_assets/stylesheets' | |
src: [ 'main.scss' ] | |
dest: 'css' | |
ext: '.css' | |
] | |
# SHELL | |
shell: | |
jekyll: | |
command: 'jekyll build' | |
# WATCH | |
watch: | |
options: | |
livereload: true | |
font: | |
files: [ 'font/*' ] | |
tasks: [ 'shell:jekyll' ] | |
markup: | |
files: [ | |
'_includes/*' | |
'_layouts/*' | |
] | |
tasks: [ 'shell:jekyll' ] | |
posts: | |
files: [ '_posts/*' ] | |
tasks: [ 'shell:jekyll' ] | |
sass: | |
files: [ '_assets/stylesheets/*' ] | |
tasks: [ | |
'sass' | |
'copy:css' | |
] | |
# DEFAULT | |
grunt.registerTask 'default', [ | |
'build' | |
'connect' | |
'watch' | |
] | |
# BUILD | |
grunt.registerTask 'build', [ | |
'clean' | |
'sass' | |
'shell:jekyll' | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment