View Source Beacon.Template.HEEx (Beacon v0.2.1)
Handles loading and compilation of HEEx templates.
Summary
Functions
Compile template
returning its AST.
@spec render(Beacon.Types.Site.t(), String.t(), map()) :: String.t()
Renders the HEEx template
with assigns
.
Use only to render isolated templates
This function should not be used to render Page Templates, its purpose is only to render isolated pieces of templates.
Example
iex> Beacon.Template.HEEx.render(:my_site, ~S|<.link patch="/contact" replace={true}><%= @text %></.link>|, %{text: "Book Meeting"})
"<a href="/contact" data-phx-link="patch" data-phx-link-state="replace">Book Meeting</a>"