Skip to content

Allow referring to compiled content in rule #44

Open
@denisdefreyne

Description

@denisdefreyne

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions