v12Explore the Rullst frameworkJoin the Rullst community on Discord
Rullst Showcase — Built entirely with Rullst v12Discover the framework →
Sandbox access
Usernamerullst_demoPasswordRullstDemoAccess2026!
✨ Ask me anything!
Rullst Crab Mascot
📄 File-Based Classic Templates (Jinja2 / Tera Engine)

Decoupled MVC Architectures in Rust

Separating presentation HTML files from Rust domain logic (Loco / Django / Rails pattern).

Author Chief Architect (Sovereign Systems)
Published At 2026-08-15 14:00 UTC
Template File templates/article.html

This page is rendered directly from an external HTML file located at 'templates/article.html'. Unlike inline macros, file-based templating enables UI designers and frontend developers to edit layout files without touching Rust source code or triggering Rust compiler recompilations.

// How Tera/Jinja2 template rendering works in Rullst:
let mut context = tera::Context::new();
context.insert("title", &"Decoupled MVC Architectures in Rust");
let html = tera.render("article.html", &context)?;

💡 Why File-Based Templates are Powerful

Developers coming from Django, Ruby on Rails, or Loco.rs often prefer keeping raw .html files in a dedicated templates/ directory. Rullst natively supports this workflow with zero ceremony, allowing full layout inheritance ({% extends "base.html" %}) and loop iterations.