Sample grunt-jekyll grunt.js
- Use the following folder structure
[root]
|-- templates/
|-- index.html (Jekyll templates)
|-- prod/
|-- dev/
|-- _config.yml (optional)
-
Add the
grunt.jsfile 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 jekyllorgrunt jekyll:serverto start a server that watches thetemplatesdirectory. -
grunt jekyll:devto process files to thedevdirectory. -
grunt jekyll:prodto process files to theproddirectory.
Of course, everything here is fully configurable to your liking.
Hey, Danny
I setup my Gruntfile.js to reflect the above, but for some reason it keeps building instead of serving the site and the watch doesn't start. It seems to be picking up the defaults from my _config.yml file instead of using the one's specified in my grunt file e.g. I tell it to build to a dev folder, but it keeps building to _site. Any ideas?