PhoenixAssetPipeline.Helpers (phoenix_asset_pipeline v2.0.2)

Copy Markdown View Source

HTML-safe helpers backed by the current asset manifest.

Import this module in Phoenix HTML contexts to render digested script, style, image, source, and SVG sprite paths.

Summary

Functions

Returns the current manifest digest.

Returns a safe <img> tag for a manifest-backed image path.

Returns a safe <script> tag for a manifest-backed JavaScript asset.

Returns a safe <source> tag with manifest-backed srcset entries.

Returns a safe inline <style> tag for a manifest-backed CSS asset.

Returns a digested SVG sprite href while preserving the fragment.

Functions

asset_digest()

Returns the current manifest digest.

img(path, attrs \\ [])

Returns a safe <img> tag for a manifest-backed image path.

The helper rewrites src and list-based srcset entries to digested URLs.

script(path, attrs \\ [])

Returns a safe <script> tag for a manifest-backed JavaScript asset.

source(attrs \\ [])

Returns a safe <source> tag with manifest-backed srcset entries.

style(path, attrs \\ [])

Returns a safe inline <style> tag for a manifest-backed CSS asset.

svg_sprite_href(path)

Returns a digested SVG sprite href while preserving the fragment.