Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Gruntfile for working with Hugo
module.exports = function(grunt) {
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.initConfig({
shell: {
options: {
stdout: true
},
server: {
command: 'hugo server --theme=redlounge --buildDrafts --watch'
},
build: {
command: 'hugo -d build/ --theme=redlounge'
},
deploy: {
command: 'rsync -az --force --progress -e "ssh" build/ user@mysite.com:/path/to/webroot/'
}
},
open: {
devserver: {
path: 'http://localhost:1313'
},
live: {
path: 'http://www.mysite.com'
}
}
});
grunt.registerTask('dev', ['open:devserver', 'shell:server']);
grunt.registerTask('build', ['shell:build']);
grunt.registerTask('deploy', ['shell:build', 'shell:deploy', 'open:live']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment