Skip to main content

Module render

Module render 

Source
Expand description

Rendering helpers shared by every route: templates to HTML, htmx request detection, and the HX-Trigger toast header.

Structs§

Hx
What htmx told us about the request. A boosted request (a normal link or form that htmx took over) still wants the whole page; a plain hx-get wants just its fragment.

Enums§

ToastKind

Functions§

html
Renders a template, turning a template error into a 500 page.
hx_redirect
HX-Redirect: htmx does a full navigation to to.
is_htmx
toast
An HX-Trigger header that makes app.js show a toast: ([toast(ToastKind::Ok, "Crawl queued")], html) from a handler.