| Page | Layout / Middleware | Component |
|---|---|---|
#[page]
async fn page() -> Markup {
html! {
h1 {
"My title"
}
main .bg-red {
"Some content"
}
}
} |
#[layout]
async fn layout(child: &str) -> Markup {
html! {
header {
"Welcome to Wini!"
}
(PreEscaped(child))
}
} |
#[component]
async fn button() -> Markup {
html! {
button
.btn-blue
onclick="jsFn()"
{
"Blue button!"
}
}
} |
Wini is a set of templates written in Rust for building websites. Instead of using WebAssembly like other common Rust front-end frameworks, Wini templates rely on server-side rendering and, when needed, TypeScript. Other options are also available, like htmx, Alpine.js, and _hyperscript. See the integration docs for htmx and Alpine.js.
The goal of Wini is therefore to be fast, lightweight, and to handle the maximum number of things that can be handled on the server, server-side.
Even though Wini doesn't use a JavaScript framework and relies purely on vanilla JavaScript, you still have the possibility of installing packages with bun and using them as you would any JavaScript front-end framework.
For more information about how Wini works and how it handles logic; such as pages, components, middleware, routing and layouts, check: https://wini.rocks
You can install Wini with cargo
cargo install winiAlternatively, you can install Wini by downloading the binary (not recommended)
curl -fsSL https://wini.rocks/install | shNote
You need root access.
After the installation of wini, you can create a new project with
wini initAll the documentation concerning the inner workings of wini and how to work with it are available at: https://wini.rocks/.
Even though Wini works, it's still in a very early state: Things might not always work as expected and there might be some breaking changes in the future; but if you are curious, and you want to help contribute to this project, you can still try it!