Created
July 2, 2015 15:34
-
-
Save tmaiaroto/288ea9fa821a8da80946 to your computer and use it in GitHub Desktop.
Gruntfile for working with Hugo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ [email protected]:/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