ScoriaWeb.Assets (scoria v0.1.2)

Copy Markdown View Source

Compile-time-embedded, self-contained dashboard assets.

The compiled CSS/JS bundles (built by mix scoria.assets.build into priv/static/scoria/) are read at COMPILE TIME and baked into this module. The Scoria root layout inlines them into a <style> / <script> tag, so the dashboard is fully styled and interactive under any mount path with no dependency on the host's asset pipeline (the Phoenix LiveDashboard / Oban Web self-contained model).

Inlining (vs hashed asset routes) keeps the library independent of the host's mount path and Plug.Static configuration. For a LiveView dashboard full page loads are rare (navigation is via live patches), so the one-time inline cost is acceptable.

Summary

Functions

True when the compiled bundle is present (i.e. mix scoria.assets.build has run).

Compiled dashboard stylesheet (inlined into the root layout).

Content hash of the compiled CSS (for cache keys / smoke checks).

Compile-time base64 data-URI for the Scoria favicon SVG (inlined into the dashboard <head>).

Compiled dashboard client bundle (inlined into the root layout).

Content hash of the compiled JS (for cache keys / smoke checks).

Functions

built?()

True when the compiled bundle is present (i.e. mix scoria.assets.build has run).

css()

Compiled dashboard stylesheet (inlined into the root layout).

css_hash()

Content hash of the compiled CSS (for cache keys / smoke checks).

favicon_data_uri()

Compile-time base64 data-URI for the Scoria favicon SVG (inlined into the dashboard <head>).

js()

Compiled dashboard client bundle (inlined into the root layout).

js_hash()

Content hash of the compiled JS (for cache keys / smoke checks).