Skip to content

Instantly share code, notes, and snippets.

@gismo141
Forked from Hypercubed/Gruntfile.js
Last active August 29, 2015 14:12
Show Gist options
  • Save gismo141/f723dda97b664b00c86e to your computer and use it in GitHub Desktop.
Save gismo141/f723dda97b664b00c86e to your computer and use it in GitHub Desktop.
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
docpad: {
files: [ "./src/**/*.*" ],
out: ["out"]
},
watch: {
src: {
files: ['<%= docpad.files %>'],
tasks: ['shell:docpad'],
},
out: {
files: ['<%= docpad.out %>/**/*'],
options: { livereload: true }
}
},
connect: {
server: {
options: {
port: 9778,
hostname: 'localhost',
base: '<%= docpad.out %>',
livereload: true,
open: true
}
}
},
clean: {
options: { force: true },
out: ['<%= docpad.out %>/*']
},
shell: {
docpad: {
options: {
stdout: true
},
command: "docpad generate --env static"
}
}
});
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.registerTask('generate', ['clean','shell:docpad']);
grunt.registerTask('server', ['connect','watch']);
grunt.registerTask('run', ['generate','server']);
grunt.registerTask('default', ['run']);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment