class

Hwaro::Content::Hooks::AssetHooks

Inherits Hwaro::Core::Lifecycle::Hookable < Reference < Object

Class methods

integrity(name : String, record : Bool = true) : String | Nil

asset_integrity(name): the SRI value of what asset(name) serves. A file the Write phase has yet to copy (or, under --cache, still holds the previous copy of) is hashed from its source — the copy is verbatim — so cold and warm builds agree. Any other path counts only when this build publishes it: a --cache build keeps the previous build's files until Finalize prunes them, and hashing one of those (a deleted static file, a now-withheld bundle asset) printed the value of a file about to vanish where a cold build raised. Nil when nothing is published there.

Source
manifest
Source
output_dir
Source
output_dir=(dir : String | Nil)
Source
output_path(name : String) : String | Nil

The emitted file asset(name) points to: the manifest bundle, else name under the output root. Nil before a build ran, or when the path leaves the output directory.

Source
publish(sources : Hash(String, String), published : Set(String) | Nil)
Source
replace_manifest(manifest : Hash(String, String))

Replace the class-level manifest (serve-mode SCSS/asset recompile). Full builds go through process_assets; this keeps fingerprint paths in sync when only static files changed.

Source

Instance methods

register_hooks(manager : Core::Lifecycle::Manager)
Source