Sample grunt-jekyll grunt.js
- Use the following folder structure
[root]
|-- templates/
|-- index.html (Jekyll templates)
|-- prod/
|-- dev/
|-- _config.yml (optional)
-
Add the
grunt.js
file below at the root of your project. -
Install the grunt-jekyll gruntmodule next to your project's grunt.js gruntfile with:
npm install grunt-jekyll
. -
Run the grunt jekyll commands:
-
grunt jekyll
orgrunt jekyll:server
to start a server that watches thetemplates
directory. -
grunt jekyll:dev
to process files to thedev
directory. -
grunt jekyll:prod
to process files to theprod
directory.
Of course, everything here is fully configurable to your liking.
Is there a way to run the server instantly at "watch"? It seems to load only after I make a change to some watched file. Probably missing something obvious here.
EDIT: Solved this using the server task and an alias (
grunt.registerTask('default', 'server watch');
).