Tags for a library's own root layout, usable from any template engine.
These functions return safe HTML, so they work in EEx templates of a
library that does not use LiveView as well as in HEEx. LiveView libraries
can use the components in PhoenixMountable.Layout instead.
<%= PhoenixMountable.HTML.meta_tags(@mount) %>
<%= PhoenixMountable.HTML.asset_tags(@mount) %>
Summary
Functions
<link> and <script> tags for the mount's asset entries, with the
request's CSP nonces and phx-track-static.
The <meta> tags a library's JavaScript reads: the CSRF token, the LiveView
socket path and transport, and the mount path (phoenix-mountable-prefix).
Functions
@spec asset_tags(PhoenixMountable.Mount.t(), keyword()) :: Phoenix.HTML.safe()
<link> and <script> tags for the mount's asset entries, with the
request's CSP nonces and phx-track-static.
Options
:only— the entry names to render. Defaults to all.:track_static— addphx-track-static. Defaults totrue.
@spec meta_tags(PhoenixMountable.Mount.t()) :: Phoenix.HTML.safe()
The <meta> tags a library's JavaScript reads: the CSRF token, the LiveView
socket path and transport, and the mount path (phoenix-mountable-prefix).
The browser helper (PhoenixMountable.connect() in JavaScript) reads them.