Skip to content

Instantly share code, notes, and snippets.

@blockloop
Created May 26, 2013 03:27
Show Gist options
  • Save blockloop/5651616 to your computer and use it in GitHub Desktop.
Save blockloop/5651616 to your computer and use it in GitHub Desktop.
hexo gruntfile generate example
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.initConfig({
watch: {
sourceFiles: {
files: ['themes/**','scaffolds/**','scripts/**','source/**','app.js'],
tasks: 'shell:hexoGen'
},
},
shell: {
hexoGen: {
command: 'hexo generate'
}
},
});
// Default task.
grunt.registerTask('default', 'watch');
};
@blockloop
Copy link
Author

If you want it to clean first you can add another shell task

clean: {
    command: 'rm -rf public'
}

and change your watch tasks to

tasks: ['shell:clean','shell:generate']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment