Skip to main content

Module templating

Module templating 

Source
Expand description

Admin UI template engine.

Stage 2 scaffolding for the 0.10.0 admin rebuild. The admin is rendered by minijinja against templates shipped at rustio-core/assets/templates/, bundled into the binary via include_str!. User projects may override any template by placing a file of the same relative path under their project’s templates/ directory — the loader chain is filesystem-first, embedded-fallback.

Stage 4a onwards consumes env() — the process-wide Arc<Environment> shared by every admin handler.

Structs§

TemplatingConfig
Runtime configuration for the admin template environment.

Constants§

BUNDLED_ASSETS
Framework CSS/JS served under /admin/static/…. The tuples are (path_under_admin_static, content_type, bytes). As of 0.11.x the admin no longer ships Bootstrap — the design system lives in admin.css, compiled at build time by build.rs from the Tailwind v4 source at assets/static/admin.css. The compiled bytes land in OUT_DIR/admin.css and are inlined here via include_bytes!.

Functions§

env
Process-wide admin template environment. Built once on first access from TemplatingConfig::default(); auto-reload is enabled under debug_assertions, so template edits are picked up without a restart in development.
environment
Construct a fresh minijinja::Environment with the framework’s embedded templates pre-registered and an optional filesystem override root. Callers typically wrap the result in Arc and cache it.