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.
@tomireland, I think this sample file is out of date. Or at least I don't think the syntax for the server options are set quite right. Yeah, in fact the option "server: true" needs to be "serve: true" with the current version of grunt-jekyll, and should be wrapped in an "options" object : eg options : {serve: true}. Also the rest of the options are just that, options and the default jekyll build and serve will work fine.