Find Related products on Amazon

Shop on Amazon

Show HN: Rocal UI – A simple template engine with Rust

Published on: 2025-08-11 10:26:16

Rocal UI - A simple template engine with Rust Although this template engine is basically intended to use with Rocal framework to craft views, it can be used anywhere with Rust. Let's begin with syntax of Rocal UI. Here is a simple example including variables, if-else control, and for-loop control. view ! {

{ { title } }

if user . id <= 10 {

{ "You are an early user!" }

{ "Click here to get rewards!" } } else if user . id <= 20 {

{ "You are kind of an early user." }

{ "Check it out for your reward." } } else {

{ "You are a regular user." }

}
} It's straight forward, isn't it? {{ variable }} : as you saw the code above, you can use any variable with it : as you saw the code above, you can use any variable ... Read full article.