okfn/okfn.github.com — pull request #252 by mchelen (2014-12-08 09:01:37+00:00)
Title: Reduce project image sizes

This is an attempt to address https://github.com/okfn/okfn.github.com/issues/164

- The Gruntfile contains a custom task `grunt projectimg` which reads the YAML frontmatter in all the `projects/_posts/` files and saves the output in JSON format as `img/projectimages.json`
- The JSON file is read by `grunt curl` to download all the images to `img/projects/`
- The images are compressed using `grunt imagemin`

The files are named using the project slugs, and `projects/index.md` and `_layouts/project.html` have been updated to use the new files when appropriate.

The advantage to this is that users only have to supply a URL, as opposed to uploading files. The downside is that someone has to periodically run the Grunt task before updating the website.

Let me know if this seems like a reasonable approach, and I can streamline the workflow to run all the commands in batch and along with the Jekyll build command.