Open takluyver opened 6 years ago
Created this branch to solve this. This is the commit in particular, but mind it isn't the latest commit in the branch. If the pull request #13 gets resolved, I can create another pull request for this branch too.
Take note too this script doesn't have any error handling for now. So if optimize_thumbnail.py fails, git will still move on to displaying the commit message window.
Does the error show up in the terminal if it fails?
Sorry I had to get some dinner :P
Went through my script and well; it actually does. Although if the hook itself, as well as optimise_thumbnail.py
(renaming that btw) errors, the hook will still allow you to proceed.
I'll make a new PR that'll have error handling.
To save bandwidth and make the site load faster, we want smaller versions of photos for use on the homepage. @tsaoyu wrote a script to do this once for all posts:
https://github.com/Maritime-Robotics-Student-Society/blog/blob/gh-pages/utilities/optimize_thumbnail.py
It should be easy to do this for a new post when we've written it. It could even be configured as a git commit hook.