]> git.draconx.ca Git - homepage.git/commitdiff
Don't regenerate smaller images so often.
authorNick Bowler <nbowler@draconx.ca>
Tue, 7 Jul 2020 01:16:36 +0000 (21:16 -0400)
committerNick Bowler <nbowler@draconx.ca>
Tue, 7 Jul 2020 01:26:10 +0000 (21:26 -0400)
It is a bit annoying how nanoc always runs the rule to regenerate
resized images, even if none of the inputs are changed at all.

Since the imgresize filter is quite expensive to run, let's try hacking
around the problem by passing in the final output filename and just
re-using that if it exists and its mtime is newer than the source image.

This is definitely not the most accurate as it will not automatically
regenerate images if the rules change, but I expect any problems due to
this will waste less of my time than regenerating dozens of redundant
images every single time the site is compiled.


No differences found