Skip to content

Instantly share code, notes, and snippets.

@dfrnswrth
Created September 2, 2013 23:48
Show Gist options
  • Save dfrnswrth/6418270 to your computer and use it in GitHub Desktop.
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.
# 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