I searched pelican gruntfile on duckduckgo and found nothing very interesting. There is this grunt-pelican repo but it doesn’t seem to work right at the time of writing this article and its ReadMe is missing some code.
Because pelican is easy to use, I decided to make my own gruntfile instead! After around half an hour, I managed to get something interesting.
First, create a package.json file to save dependencies using this command:
Then, install the fun stuff
Everything will be saved in your package.json, so next time you want to install them, you only have to run npm install. The package file will contain something like this:
Here’s my awesome Gruntfile.coffee:
Note: make sure you have pelican installed with pip install pelican. Replace gableroux with your own theme name (where your magic files are stored) and enjoy the Grunt awesomeness by running grunt in a terminal.
Here’s the jshintrc file I used:
And my coffeelint.json file:
The fun part
Now, when I write new content in markdown files, or when I edit my theme, my browser automagically refresh my website using LiveReload Chrome Extension on my second screen. Having a workflow updating like this lets me write quality content (can you confirm this?), instead of running a bunch of scripts manually every time only to fix a typo on a blog post.
September 2015 edit
You should use Browser Sync instead, it’s even more awesome!