Skip to content

Instantly share code, notes, and snippets.

@tmaiaroto
Created July 2, 2015 15:34
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tmaiaroto/288ea9fa821a8da80946 to your computer and use it in GitHub Desktop.
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