forge/lib.rs
1//! Forge runtime: stack buffer for `@push`/`@stack`, `@vite` asset helper, escape primitives.
2
3pub mod escape;
4pub mod helpers;
5pub mod stack;
6pub mod vite;
7
8pub use askama;
9pub use askama::Template;
10pub use helpers::{class_list, lang, lang_choice, style_list, FormErrors, OldInput};
11
12/// Re-export the common Forge-style template builder.
13pub trait View: askama::Template {
14 fn render_view(&self) -> Result<String, askama::Error> {
15 let raw = self.render()?;
16 Ok(stack::postprocess(&raw))
17 }
18}
19
20impl<T: askama::Template> View for T {}