mirror of
https://github.com/actix/examples
synced 2025-01-22 22:05:57 +01:00
Update template_yarte (#190)
This commit is contained in:
parent
dc6e1cc762
commit
663f8a64a8
@ -1,14 +1,14 @@
|
||||
[package]
|
||||
name = "template_yarte"
|
||||
version = "0.0.1"
|
||||
authors = ["Rust-iendo <riendocontributions@gmail.com>"]
|
||||
authors = ["Juan Aguilar Santillana <mhpoin@gmail.com>"]
|
||||
publish = false
|
||||
edition = "2018"
|
||||
|
||||
workspace = ".."
|
||||
|
||||
[dependencies]
|
||||
env_logger = "0.6"
|
||||
env_logger = "0.7"
|
||||
|
||||
yarte = { version = "0.3", features=["with-actix-web"] }
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
# yarte
|
||||
|
||||
Minimal example of using template [yarte](https://gitlab.com/r-iendo/yarte) that displays a form.
|
||||
Minimal example of using template [yarte](https://github.com/botika/yarte) that displays a form.
|
||||
|
||||
[Template benchmarks in stable](https://gitlab.com/botika/template-benchmarks-rs)
|
||||
[Template benchmarks in stable](https://github.com/botika/template-bench-rs)
|
||||
|
||||
```bash
|
||||
cargo test
|
||||
|
@ -1,5 +1,3 @@
|
||||
use yarte::recompile;
|
||||
|
||||
fn main() {
|
||||
recompile::when_changed();
|
||||
yarte::recompile::when_changed();
|
||||
}
|
||||
|
10
template_yarte/templates/body.hbs
Normal file
10
template_yarte/templates/body.hbs
Normal file
@ -0,0 +1,10 @@
|
||||
<body>
|
||||
|
||||
{{~#if let Some(name) = query.get("name") }}
|
||||
{{ let lastname = query.get("lastname").ok_or(yarte::Error)? }}
|
||||
{{> card/hi ~}}
|
||||
{{ else ~}}
|
||||
{{> card/form ~}}
|
||||
{{/if ~}}
|
||||
|
||||
</body>
|
@ -1,12 +1,8 @@
|
||||
{{! Simple example !}}
|
||||
{{> doc/t ~}}
|
||||
<html>
|
||||
{{~> doc/head title = "Actix web" ~}}
|
||||
<body>
|
||||
{{~#if let Some(name) = query.get("name") }}
|
||||
{{ let lastname = query.get("lastname").ok_or(yarte::Error)? }}
|
||||
{{> card/hi ~}}
|
||||
{{ else ~}}
|
||||
{{> card/form ~}}
|
||||
{{/if ~}}
|
||||
</body></html>
|
||||
|
||||
{{~> doc/head title = "Actix web" }}
|
||||
{{~> body ~}}
|
||||
|
||||
</html>
|
||||
|
Loading…
x
Reference in New Issue
Block a user