For cache-busting purposes, it would be useful to write a file to a path that depends on the compiled content:
compile '/style/screen.css' do
hash = Digest::SHA1.hexdigest(item_rep.compiled_content)
write "/style/screen-#{hash}.css"
end
This is not currently possible, because there is a chicken-and-egg problem (a rule defines how to compile an item rep, but the rule cannot be applied until after the item rep is compiled) which might only be solvable by putting severe restrictions on where the compiled content can be accessed — ideally, only in #write in a compilation rule.
Perhaps implement it by creating an item_rep.fingerprinted_name so nanoc can keep control where it's being used and prevent people from using compiled content in other places.
For cache-busting purposes, it would be useful to write a file to a path that depends on the compiled content:
This is not currently possible, because there is a chicken-and-egg problem (a rule defines how to compile an item rep, but the rule cannot be applied until after the item rep is compiled) which might only be solvable by putting severe restrictions on where the compiled content can be accessed — ideally, only in #write in a compilation rule.