Grunt and Hugo: A Fast Iteration Cookbook

This is a selection of code snippets that can be used to assemble a nice live editing environment for static sites using Grunt. The focus is on Hugo, LESS and CoffeeScript, but most of the code could easily be repurposed for similar tools. In addition to the markup and script compilation, we’ll add automatic image resizing using grunt-responsive-images.

The Gruntfile broken down here is in CoffeeScript since that’s what I happened to use, but it should be straightforward to transliterate into plain JavaScript if required.