As long as your Rust service only speaks JSON, you can forget about markup. But sooner or later a real page moves to Rust, and that is when you notice that half of a Laravel app is Blade and half of the content is Markdown. That is exactly the case with DevSense: every article is stored as Markdown and rendered with league/commonmark, and every page is assembled from Blade components.
Below is a detailed breakdown: what Rust offers as of December 2026 in place of Blade and league/commonmark, how the same page looks in each template engine, and what we chose for ourselves.
TL;DR
- Instead of Blade: Jinja-syntax template engines: MiniJinja (already built into Laravel Rust), Askama (templates compile to Rust code), Tera. And separately Maud: HTML right inside Rust code.
- Instead of league/commonmark: comrak (closest to GitHub and to our PHP setup), pulldown-cmark (the fastest), markdown-rs (strictly by the spec, safe by default).
- Sanitizer: ammonia, for when HTML in Markdown is allowed but can't be trusted.
- Our pick for DevSense: MiniJinja via Laravel Rust views, plus comrak. We'll add template translations ourselves: Laravel Rust 0.1.6 doesn't have them yet.
The crate landscape as of December 4, 2026
Numbers from crates.io on the publication date; downloads are all-time.
Templates:
| Crate | Version | Released | Downloads | How it works |
|---|---|---|---|---|
| MiniJinja | 3.1.0 | 07.11.2026 | ≈ 47M | Loads templates at runtime, Jinja2 syntax |
| Askama | 0.16.1 | 04.09.2026 | ≈ 65M | Compiles templates into Rust code |
| Tera | 2.4.0 | 11.09.2026 | ≈ 46M | Loads templates at runtime, Jinja-like |
| Maud | 0.27.0 | 02.02.2025 | ≈ 9.5M | HTML macro inside Rust code |
| Sailfish | 0.11.8 | 18.09.2026 | ≈ 0.7M | Compiled, <%= %> syntax |
Markdown:
| Crate | Version | Released | Downloads | How it works |
|---|---|---|---|---|
| pulldown-cmark | 0.13.6 | 30.10.2026 | ≈ 231M | Event stream, no tree |
| comrak | 1.3.0 | 03.12.2026 | ≈ 11.4M | Document tree, port of cmark-gfm |
| markdown-rs | 1.0.0 | 23.04.2025 | ≈ 18M | mdast tree, strict spec |
| ammonia | 4.2.5 | 13.11.2026 | ≈ 23M | HTML sanitizer |
The test page
To keep the comparison fair, let's take a real DevSense page: turning off the team space e-mail summary from a link in the e-mail. Here it is in Blade, in full:
{{-- Turn the team space e-mail summary off from the e-mail link (signed, no sign-in). --}}
<x-layout :title="__('zones.digest.off.title') . ' | DevSense'" :description="__('zones.digest.off.title')" robots="noindex, nofollow">
<div class="auth-page">
<section class="auth-card" aria-labelledby="digest-off-title">
<header class="auth-card__header">
<h1 class="auth-card__title" id="digest-off-title">{{ $done ? __('zones.digest.off.done_title') : __('zones.digest.off.title') }}</h1>
<p class="auth-card__subtitle">{{ $done ? __('zones.digest.off.done') : __('zones.digest.off.lead') }}</p>
</header>
@unless ($done)
<form method="POST" action="{{ $action }}" class="auth-form">
@csrf
<x-ui.button type="submit" size="lg" block>{{ __('zones.digest.off.button') }}</x-ui.button>
</form>
@endunless
</section>
</div>
</x-layout>
Seventeen lines, and they contain everything typical: a shared layout, a button component, a condition, CSRF, translations, escaping.
MiniJinja: the Jinja2 already built into Laravel Rust
What it is. A template engine with the syntax and behavior of Python's Jinja2. Templates are loaded at runtime rather than compiled into the binary, so editing a template doesn't require a rebuild. In Laravel Rust, it is what renders every .html view.
Our page in MiniJinja inside Laravel Rust:
{% extends "layouts.site" %}
{% from "components.ui" import button %}
{% block title %}{{ title }} | DevSense{% endblock %}
{% block content %}
<div class="auth-page">
<section class="auth-card" aria-labelledby="digest-off-title">
<header class="auth-card__header">
<h1 class="auth-card__title" id="digest-off-title">{{ heading }}</h1>
<p class="auth-card__subtitle">{{ lead }}</p>
</header>
{% if not done %}
<form method="POST" action="{{ action }}" class="auth-form">
{{ csrf_field() }}
{% call button(type="submit", size="lg", block=true) %}{{ button_label }}{% endcall %}
</form>
{% endif %}
</section>
</div>
{% endblock %}
The handler passes data the same way view() does in PHP:
pub async fn page(Params(user): Params<u64>) -> laravel::Result<View> {
// … the signed link and the user are checked, as in PHP …
Ok(view("team.digest_off", data! { done: false, action, title, heading, lead, button_label }))
}
What Laravel Rust gives you out of the box. Inheritance (extends, block, super()), include, macros instead of components (with caller() instead of a slot), {{ }} auto-escaping, and the safe filter instead of {!! !!}. From Laravel's helpers: csrf_field(), csrf_token(), route(), url(), vite(), old(), error(), head(), csp_nonce(). In debug mode templates are re-read from disk on every request; in production they are compiled once. The resources/views directory has to be deployed to the server next to the binary.
What's missing. Translations. In 0.1.6 templates have neither __() nor trans(), and the docs have no section on localization. That's why in the example above the headings arrive as ready-made strings from the handler. A multilingual site will have to register its own translation function in MiniJinja, and we'll do that on one of the upcoming days of the series.
The cost. Template errors, like a typo in a variable name or a wrong filter, only show up at render time, not at build time. Just like in Blade.
Askama: templates checked by the compiler
What it is. The same Jinja syntax, but the template is turned into Rust code at build time. The data struct and the template are linked with an attribute:
use askama::Template;
#[derive(Template)]
#[template(path = "team/digest_off.html")]
struct DigestOff<'a> {
done: bool,
action: &'a str,
heading: &'a str,
lead: &'a str,
button_label: &'a str,
}
let html = DigestOff { done, action, heading, lead, button_label }.render()?;
The template is almost identical to the MiniJinja one. But if you write {{ headng }} in it, the program won't compile: the compiler knows every field of the struct.
Pros. The fastest rendering in the Jinja family, errors caught at build time, typed data.
Cons. Every template edit means a rebuild, and in Rust that takes minutes, not seconds. It isn't built into Laravel Rust: you'll have to wire up the csrf_field(), vite() and route() helpers yourself.
History. In 2024 the project briefly split: a fork called Rinja appeared, and even docs.rs switched to it. Later the fork was merged back, and now it's a single Askama again.
Tera: the veteran of the Jinja family
What it is. One of the oldest Rust template engines, with syntax close to Jinja2 and Django. Loads templates at runtime. The stable second version came out in summer 2026.
Where you'll see it. The Zola static site generator and the Loco framework.
For us. Feature-wise it's close to MiniJinja. But MiniJinja is already built into Laravel Rust along with the helpers, so a second Jinja engine in the same app is needless complexity.
Maud: no templates, just Rust
What it is. A completely different approach: HTML is written with a macro right in the code.
use maud::html;
let page = html! {
section.auth-card aria-labelledby="digest-off-title" {
h1.auth-card__title #digest-off-title { (heading) }
p.auth-card__subtitle { (lead) }
@if !done {
form.auth-form method="POST" action=(action) {
button type="submit" { (button_label) }
}
}
}
};
Pros. The compiler checks everything: both the markup and the data. Escaping by default.
Cons. Only someone who writes Rust can edit the markup; a front-end developer with an HTML template won't be at home here. The last release was in February 2025.
Who it's for. Small services where all the markup is in the developer's hands.
One more option is Sailfish: compiled, with EJS-style <%= %> syntax, very fast, but with a small community. As for a literal Blade port in Rust, so far it exists only as experimental 0.1 crates, and we wouldn't put those in production.
Cheat sheet: Blade → Jinja
| Blade | MiniJinja / Askama / Tera |
|---|---|
{{ $name }} |
{{ name }} |
{!! $html !!} |
{{ html|safe }} |
@if ($x) … @elseif … @else … @endif |
{% if x %} … {% elif … %} … {% else %} … {% endif %} |
@unless ($done) |
{% if not done %} |
@foreach ($users as $user) |
{% for user in users %} |
@forelse … @empty |
{% for … %} … {% else %} … {% endfor %} |
$loop->first |
loop.first |
@extends('layouts.site') |
{% extends "layouts.site" %} |
@section('content') … @endsection |
{% block content %} … {% endblock %} |
@parent |
{{ super() }} |
@include('partials.nav') |
{% include "partials.nav" %} |
<x-ui.button>…</x-ui.button> |
{% call button() %}…{% endcall %} |
$slot |
caller() |
@csrf |
{{ csrf_field() }} (Laravel Rust) |
@vite('…') |
{{ vite("…") }} (Laravel Rust) |
{{-- … --}} |
{# … #} |
__('key') |
not in Laravel Rust 0.1.6, roll your own function |
Markdown: comrak, pulldown-cmark and markdown-rs
For comparison, here's how DevSense renders Markdown today:
$environment = new Environment([
'html_input' => 'allow',
]);
$environment->addExtension(new CommonMarkCoreExtension);
$environment->addExtension(new TableExtension);
$environment->addExtension(new FrontMatterExtension);
On top of that, there's a custom code block renderer (a header with the file path and a "Copy" button) and post-processing: GitHub alerts, scrollable tables, a hand-built table of contents. HTML is allowed in articles because we write the articles ourselves.
comrak: closest to GitHub and to our PHP
What it is. It started as a direct port of cmark-gfm, the parser behind Markdown on GitHub. Today it passes every CommonMark and GFM test and builds a document tree that you can walk and modify before rendering.
use comrak::{markdown_to_html, Options};
let mut options = Options::default();
options.extension.table = true;
options.extension.front_matter_delimiter = Some("---".to_owned());
options.extension.alerts = true;
let html = markdown_to_html(markdown, &options);
What it has. Tables, strikethrough, autolinks, task lists, footnotes, front matter, GitHub alerts (> [!NOTE]), heading anchor prefixes, math, and code highlighting via syntect. Raw HTML and dangerous links are stripped by default; for trusted content there's a flag that turns this off.
For us. Almost everything we do in PHP with regexes after rendering, comrak has built in: alerts are an extension, and tables get a custom renderer over the tree. That means the HTML can match the PHP output byte for byte.
pulldown-cmark: the fastest
What it is. It doesn't build a tree: it emits a stream of events like "paragraph started", "text", "link ended". That's fast and memory-efficient. rustdoc and mdBook run on it.
use pulldown_cmark::{html, Options, Parser};
let parser = Parser::new_ext(markdown, Options::ENABLE_TABLES | Options::ENABLE_YAML_STYLE_METADATA_BLOCKS);
let mut out = String::new();
html::push_html(&mut out, parser);
A note on safety. pulldown-cmark passes raw HTML through untouched. That's fine for your own content; user content must go through a sanitizer:
let safe = ammonia::clean(&out);
For us. A custom code block renderer means swapping events in the stream. Doable, but noticeably harder than walking the tree in comrak.
markdown-rs: strict and safe
What it is. The markdown crate from the author of the micromark/remark ecosystem in the JavaScript world. It strictly follows the CommonMark spec, supports GFM, MDX and front matter, and builds an mdast tree. It escapes raw HTML by default, which is exactly why the Laravel Rust docs recommend it for user posts:
let body = Html::raw(markdown::to_html(&post.body));
view("posts.show", data! { post }).with_html("body", body)
Downside. The last release was in April 2025, and development moves slower than comrak's.
What we chose
Templates: MiniJinja via Laravel Rust views. Converting from Blade is mechanical (see the table above), Laravel's helpers are already there, and editing a template needs no rebuild. We'll keep Askama in reserve for hot pages, if measurements show template rendering is noticeable next to the database.
Markdown: comrak. It's the only one that can realistically produce HTML matching our current PHP output byte for byte: document tree, alerts, front matter, custom code rendering.
What's missing and what we'll build ourselves:
- template translations: our own
__()function in MiniJinja plus exporting strings fromlang/*.phpto JSON at build time, following the shared skills file from Day 6; - components: our Blade components (
x-ui.button,x-ui.search) will become MiniJinja macros; - verification: we'll compare the Rust-built HTML of every article with the PHP output. As long as there's even one difference, PHP keeps serving articles in production.
The plan for the next days of the "From Laravel to Laravel Rust" series: first Markdown, verified against every article, then the shared site layout and a simple page, then one or two real articles in production.
Links
- Views in Laravel Rust:
view(),with_html, custom engines for other extensions - Templates in Laravel Rust: layouts, macros, helpers
- MiniJinja: engine documentation
- Askama: the Askama book
- Tera: Tera documentation
- Maud: HTML macros
- comrak: extensions and render options
- pulldown-cmark: event-based parser
- markdown-rs: CommonMark, GFM, MDX
- ammonia: HTML sanitizer
- Web in Rust in 2026: Axum, Actix Web, Loco, Rocket and Laravel Rust
- From Laravel to Laravel Rust. Day 7: a beta update and the mystery of the empty log