#askama — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #askama, aggregated by home.social.
-
This time I started to do it for real and I restarted from scratch the Rust rewrite of my website (as a "real" Rust beginner project) and this time I'm using Askama for the templating stuff.
(And It's new repo is right here: https://codeberg.org/Breadly/blair )
-
This time I started to do it for real and I restarted from scratch the Rust rewrite of my website (as a "real" Rust beginner project) and this time I'm using Askama for the templating stuff.
(And It's new repo is right here: https://codeberg.org/Breadly/blair )
-
This time I started to do it for real and I restarted from scratch the Rust rewrite of my website (as a "real" Rust beginner project) and this time I'm using Askama for the templating stuff.
(And It's new repo is right here: https://codeberg.org/Breadly/blair )
-
Since we're talking about responses let’s address the elephant in the room: HTML.
In Ruby pretty much every framework support some form of templating. Even barebones Sinatra gives you ERB out of the box and pretty much any other template engine is only one line in the gemfile away.
Axum doesn't provide any templating. You’ll have to bring your own.
I picked #Askama as it was the first templating engine on Are We Web Yet.
It's a dialect of Jinja. But maybe not 100% compatible. No matter.
One thing you learn fast is that in Rust everything is a type. So your template has to have an actual template and a struct that provides data for the template. You can't just put random code in your templates. On one hand it’s great as you can't by accident have n+1 queries in your template. On the other, to change something on the page you might to edit three files: the actual template, the struct for the template, and the handler to populate the struct.
There's no support for layouts. Well, there's kinda. Through template inheritance. It’s where you extend your layout by overriding some blocks in it. It's much more awkward than in Ruby. In Ruby layouts are conceptually separate. In Askama your template struct has to provide all the data for the template and all its parent templates. I don't even know if it's possible to render the same template in different layouts. The thing that is extremely easy in Ruby.
There's also no support for partials. At best you can insert renders of other templates. But that's awkward for many of the same reasons (mostly around providing data for the templates).
One major downside is that Askama uses proc macro to compile the templates to Rust. It makes it extremely fast but debugging templates is a nightmare. It gives you an error that something is missing or has a wrong type but doesn't tell you what it is or where in the template it is. Even with enabled proc macro backtraces it gives you a snippet of generated Rust code and not the template. Even the barebones ERB will give you the exact position in the template in case of an error.
So yeah, lots of frustration.
-
Since we're talking about responses let’s address the elephant in the room: HTML.
In Ruby pretty much every framework support some form of templating. Even barebones Sinatra gives you ERB out of the box and pretty much any other template engine is only one line in the gemfile away.
Axum doesn't provide any templating. You’ll have to bring your own.
I picked #Askama as it was the first templating engine on Are We Web Yet.
It's a dialect of Jinja. But maybe not 100% compatible. No matter.
One thing you learn fast is that in Rust everything is a type. So your template has to have an actual template and a struct that provides data for the template. You can't just put random code in your templates. On one hand it’s great as you can't by accident have n+1 queries in your template. On the other, to change something on the page you might to edit three files: the actual template, the struct for the template, and the handler to populate the struct.
There's no support for layouts. Well, there's kinda. Through template inheritance. It’s where you extend your layout by overriding some blocks in it. It's much more awkward than in Ruby. In Ruby layouts are conceptually separate. In Askama your template struct has to provide all the data for the template and all its parent templates. I don't even know if it's possible to render the same template in different layouts. The thing that is extremely easy in Ruby.
There's also no support for partials. At best you can insert renders of other templates. But that's awkward for many of the same reasons (mostly around providing data for the templates).
One major downside is that Askama uses proc macro to compile the templates to Rust. It makes it extremely fast but debugging templates is a nightmare. It gives you an error that something is missing or has a wrong type but doesn't tell you what it is or where in the template it is. Even with enabled proc macro backtraces it gives you a snippet of generated Rust code and not the template. Even the barebones ERB will give you the exact position in the template in case of an error.
So yeah, lots of frustration.
-
Since we're talking about responses let’s address the elephant in the room: HTML.
In Ruby pretty much every framework support some form of templating. Even barebones Sinatra gives you ERB out of the box and pretty much any other template engine is only one line in the gemfile away.
Axum doesn't provide any templating. You’ll have to bring your own.
I picked #Askama as it was the first templating engine on Are We Web Yet.
It's a dialect of Jinja. But maybe not 100% compatible. No matter.
One thing you learn fast is that in Rust everything is a type. So your template has to have an actual template and a struct that provides data for the template. You can't just put random code in your templates. On one hand it’s great as you can't by accident have n+1 queries in your template. On the other, to change something on the page you might to edit three files: the actual template, the struct for the template, and the handler to populate the struct.
There's no support for layouts. Well, there's kinda. Through template inheritance. It’s where you extend your layout by overriding some blocks in it. It's much more awkward than in Ruby. In Ruby layouts are conceptually separate. In Askama your template struct has to provide all the data for the template and all its parent templates. I don't even know if it's possible to render the same template in different layouts. The thing that is extremely easy in Ruby.
There's also no support for partials. At best you can insert renders of other templates. But that's awkward for many of the same reasons (mostly around providing data for the templates).
One major downside is that Askama uses proc macro to compile the templates to Rust. It makes it extremely fast but debugging templates is a nightmare. It gives you an error that something is missing or has a wrong type but doesn't tell you what it is or where in the template it is. Even with enabled proc macro backtraces it gives you a snippet of generated Rust code and not the template. Even the barebones ERB will give you the exact position in the template in case of an error.
So yeah, lots of frustration.
-
Since we're talking about responses let’s address the elephant in the room: HTML.
In Ruby pretty much every framework support some form of templating. Even barebones Sinatra gives you ERB out of the box and pretty much any other template engine is only one line in the gemfile away.
Axum doesn't provide any templating. You’ll have to bring your own.
I picked #Askama as it was the first templating engine on Are We Web Yet.
It's a dialect of Jinja. But maybe not 100% compatible. No matter.
One thing you learn fast is that in Rust everything is a type. So your template has to have an actual template and a struct that provides data for the template. You can't just put random code in your templates. On one hand it’s great as you can't by accident have n+1 queries in your template. On the other, to change something on the page you might to edit three files: the actual template, the struct for the template, and the handler to populate the struct.
There's no support for layouts. Well, there's kinda. Through template inheritance. It’s where you extend your layout by overriding some blocks in it. It's much more awkward than in Ruby. In Ruby layouts are conceptually separate. In Askama your template struct has to provide all the data for the template and all its parent templates. I don't even know if it's possible to render the same template in different layouts. The thing that is extremely easy in Ruby.
There's also no support for partials. At best you can insert renders of other templates. But that's awkward for many of the same reasons (mostly around providing data for the templates).
One major downside is that Askama uses proc macro to compile the templates to Rust. It makes it extremely fast but debugging templates is a nightmare. It gives you an error that something is missing or has a wrong type but doesn't tell you what it is or where in the template it is. Even with enabled proc macro backtraces it gives you a snippet of generated Rust code and not the template. Even the barebones ERB will give you the exact position in the template in case of an error.
So yeah, lots of frustration.
-
Since we're talking about responses let’s address the elephant in the room: HTML.
In Ruby pretty much every framework support some form of templating. Even barebones Sinatra gives you ERB out of the box and pretty much any other template engine is only one line in the gemfile away.
Axum doesn't provide any templating. You’ll have to bring your own.
I picked #Askama as it was the first templating engine on Are We Web Yet.
It's a dialect of Jinja. But maybe not 100% compatible. No matter.
One thing you learn fast is that in Rust everything is a type. So your template has to have an actual template and a struct that provides data for the template. You can't just put random code in your templates. On one hand it’s great as you can't by accident have n+1 queries in your template. On the other, to change something on the page you might to edit three files: the actual template, the struct for the template, and the handler to populate the struct.
There's no support for layouts. Well, there's kinda. Through template inheritance. It’s where you extend your layout by overriding some blocks in it. It's much more awkward than in Ruby. In Ruby layouts are conceptually separate. In Askama your template struct has to provide all the data for the template and all its parent templates. I don't even know if it's possible to render the same template in different layouts. The thing that is extremely easy in Ruby.
There's also no support for partials. At best you can insert renders of other templates. But that's awkward for many of the same reasons (mostly around providing data for the templates).
One major downside is that Askama uses proc macro to compile the templates to Rust. It makes it extremely fast but debugging templates is a nightmare. It gives you an error that something is missing or has a wrong type but doesn't tell you what it is or where in the template it is. Even with enabled proc macro backtraces it gives you a snippet of generated Rust code and not the template. Even the barebones ERB will give you the exact position in the template in case of an error.
So yeah, lots of frustration.
-
yay i finished rewriting my website from #sveltekit to #Rust with #askama
:rust: live on https://vavakado.xyz!!!! :cirnouwu:
old version available on: https://old.vavakado.xyz :cirnothinking: if anyone wants to test perf or smth (don't DDOS me pls)
-
yay i finished rewriting my website from #sveltekit to #Rust with #askama
:rust: live on https://vavakado.xyz!!!! :cirnouwu:
old version available on: https://old.vavakado.xyz :cirnothinking: if anyone wants to test perf or smth (don't DDOS me pls)
-
yay i finished rewriting my website from #sveltekit to #Rust with #askama
:rust: live on https://vavakado.xyz!!!! :cirnouwu:
old version available on: https://old.vavakado.xyz :cirnothinking: if anyone wants to test perf or smth (don't DDOS me pls)
-
yay i finished rewriting my website from #sveltekit to #Rust with #askama
:rust: live on https://vavakado.xyz!!!! :cirnouwu:
old version available on: https://old.vavakado.xyz :cirnothinking: if anyone wants to test perf or smth (don't DDOS me pls)
-
yay i finished rewriting my website from #sveltekit to #Rust with #askama
:rust: live on https://vavakado.xyz!!!! :cirnouwu:
old version available on: https://old.vavakado.xyz :cirnothinking: if anyone wants to test perf or smth (don't DDOS me pls)
-
@daubers Perhaps #Askama may be what you're looking for https://github.com/djc/askama
-
@daubers Perhaps #Askama may be what you're looking for https://github.com/djc/askama
-
@daubers Perhaps #Askama may be what you're looking for https://github.com/djc/askama
-
@daubers Perhaps #Askama may be what you're looking for https://github.com/djc/askama
-
@daubers Perhaps #Askama may be what you're looking for https://github.com/djc/askama
-
✨ A wonderful tutorial on Rust+Htmx+Tailwind
👉 Axum as Backend server
👉 htmx for reactivity on the UI
👉 Askama for templating
👉 Tailwind CSShttps://joeymckenzie.tech/blog/templates-with-rust-axum-htmx-askama/
Credits: @_joeyMcKenzie
#rustlang #htmx #askama #axum #tailwindcss #tailwind #developers #rust
-
✨ A wonderful tutorial on Rust+Htmx+Tailwind
👉 Axum as Backend server
👉 htmx for reactivity on the UI
👉 Askama for templating
👉 Tailwind CSShttps://joeymckenzie.tech/blog/templates-with-rust-axum-htmx-askama/
Credits: @_joeyMcKenzie
#rustlang #htmx #askama #axum #tailwindcss #tailwind #developers #rust
-
✨ A wonderful tutorial on Rust+Htmx+Tailwind
👉 Axum as Backend server
👉 htmx for reactivity on the UI
👉 Askama for templating
👉 Tailwind CSShttps://joeymckenzie.tech/blog/templates-with-rust-axum-htmx-askama/
Credits: @_joeyMcKenzie
#rustlang #htmx #askama #axum #tailwindcss #tailwind #developers #rust
-
✨ A wonderful tutorial on Rust+Htmx+Tailwind
👉 Axum as Backend server
👉 htmx for reactivity on the UI
👉 Askama for templating
👉 Tailwind CSShttps://joeymckenzie.tech/blog/templates-with-rust-axum-htmx-askama/
Credits: @_joeyMcKenzie
#rustlang #htmx #askama #axum #tailwindcss #tailwind #developers #rust
-
✨ A wonderful tutorial on Rust+Htmx+Tailwind
👉 Axum as Backend server
👉 htmx for reactivity on the UI
👉 Askama for templating
👉 Tailwind CSShttps://joeymckenzie.tech/blog/templates-with-rust-axum-htmx-askama/
Credits: @_joeyMcKenzie
#rustlang #htmx #askama #axum #tailwindcss #tailwind #developers #rust
-
I developed and published it in about 6 days in my free time. For people that say that #Rust is an overkill for backends 🤨
It is often a matter of practice to be productive in any language. Rust already offers the ecosystem.
I wrote a helper library that is highly opinionated to be even more productive and share code between my #Axum + #SQLx + #Askama projects:
https://docs.rs/oxi-axum-helpers/latest/oxi_axum_helpers/
It is not documented yet 😅 I will document it and might even write a blog post about it 😃
-
I developed and published it in about 6 days in my free time. For people that say that #Rust is an overkill for backends 🤨
It is often a matter of practice to be productive in any language. Rust already offers the ecosystem.
I wrote a helper library that is highly opinionated to be even more productive and share code between my #Axum + #SQLx + #Askama projects:
https://docs.rs/oxi-axum-helpers/latest/oxi_axum_helpers/
It is not documented yet 😅 I will document it and might even write a blog post about it 😃
-
I developed and published it in about 6 days in my free time. For people that say that #Rust is an overkill for backends 🤨
It is often a matter of practice to be productive in any language. Rust already offers the ecosystem.
I wrote a helper library that is highly opinionated to be even more productive and share code between my #Axum + #SQLx + #Askama projects:
https://docs.rs/oxi-axum-helpers/latest/oxi_axum_helpers/
It is not documented yet 😅 I will document it and might even write a blog post about it 😃
-
I developed and published it in about 6 days in my free time. For people that say that #Rust is an overkill for backends 🤨
It is often a matter of practice to be productive in any language. Rust already offers the ecosystem.
I wrote a helper library that is highly opinionated to be even more productive and share code between my #Axum + #SQLx + #Askama projects:
https://docs.rs/oxi-axum-helpers/latest/oxi_axum_helpers/
It is not documented yet 😅 I will document it and might even write a blog post about it 😃
-
I developed and published it in about 6 days in my free time. For people that say that #Rust is an overkill for backends 🤨
It is often a matter of practice to be productive in any language. Rust already offers the ecosystem.
I wrote a helper library that is highly opinionated to be even more productive and share code between my #Axum + #SQLx + #Askama projects:
https://docs.rs/oxi-axum-helpers/latest/oxi_axum_helpers/
It is not documented yet 😅 I will document it and might even write a blog post about it 😃
-
@cindox Rocket is stagnating and Axum is going up like a rocket 🚀😉
My recommendations would be #Axum and #SQLx.
I don't have experience with #RustLang frontends (e.g. yew) so far, but if you just want Templates, check out #Askama
My blog posts might be helpful:
Axum + Askama: https://mo8it.com/blog/getting-started-with-rust-backends/
SQLx: https://mo8it.com/blog/sqlx-interacting-with-databases-in-rust/
-
@cindox Rocket is stagnating and Axum is going up like a rocket 🚀😉
My recommendations would be #Axum and #SQLx.
I don't have experience with #RustLang frontends (e.g. yew) so far, but if you just want Templates, check out #Askama
My blog posts might be helpful:
Axum + Askama: https://mo8it.com/blog/getting-started-with-rust-backends/
SQLx: https://mo8it.com/blog/sqlx-interacting-with-databases-in-rust/
-
@cindox Rocket is stagnating and Axum is going up like a rocket 🚀😉
My recommendations would be #Axum and #SQLx.
I don't have experience with #RustLang frontends (e.g. yew) so far, but if you just want Templates, check out #Askama
My blog posts might be helpful:
Axum + Askama: https://mo8it.com/blog/getting-started-with-rust-backends/
SQLx: https://mo8it.com/blog/sqlx-interacting-with-databases-in-rust/
-
@cindox Rocket is stagnating and Axum is going up like a rocket 🚀😉
My recommendations would be #Axum and #SQLx.
I don't have experience with #RustLang frontends (e.g. yew) so far, but if you just want Templates, check out #Askama
My blog posts might be helpful:
Axum + Askama: https://mo8it.com/blog/getting-started-with-rust-backends/
SQLx: https://mo8it.com/blog/sqlx-interacting-with-databases-in-rust/
-
@cindox Rocket is stagnating and Axum is going up like a rocket 🚀😉
My recommendations would be #Axum and #SQLx.
I don't have experience with #RustLang frontends (e.g. yew) so far, but if you just want Templates, check out #Askama
My blog posts might be helpful:
Axum + Askama: https://mo8it.com/blog/getting-started-with-rust-backends/
SQLx: https://mo8it.com/blog/sqlx-interacting-with-databases-in-rust/
-
Dec 23
forgot to update regularly.
- working on my web app
- using #axum web framework
- for templating picked #askama
- using #TailwindCSS for styling
- for db using #surrealdb
- basic structure is done
- next need to add error handling, tracing
so far enjoying writing #RustLang -
Dec 23
forgot to update regularly.
- working on my web app
- using #axum web framework
- for templating picked #askama
- using #TailwindCSS for styling
- for db using #surrealdb
- basic structure is done
- next need to add error handling, tracing
so far enjoying writing #RustLang