middleman/middleman — pull request #341 by bhollis (2012-04-04 07:18:52+00:00)
Title: asset_hash considers output file contents for hash

Fix the `asset_hash` extension to operate on the hash of the rendered output rather than just the source file. This prevents generating the same hash for a file when partials it uses change, or if a helper it uses produces different output. As part of this change I removed the caching from `Sitemap::Page#destination_path` and asset_hash since they were preventing recalculation of path/hash when partials changed, and I rewrote the Sprockets extension to expose the Sprockets environment to other extensions, which included consolidating the JS and CSS Sprockets environments into one.

This took a few dead ends and a lot of reading through the Rails and Sprockets source code, but I'm glad we didn't release `asset_hash`, even in a beta, without it. This fixes issue #337.