mirror of
https://github.com/actix/examples
synced 2025-02-02 09:39:03 +01:00
Update template_yarte (#190)
This commit is contained in:
parent
dc6e1cc762
commit
663f8a64a8
@ -1,14 +1,14 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "template_yarte"
|
name = "template_yarte"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
authors = ["Rust-iendo <riendocontributions@gmail.com>"]
|
authors = ["Juan Aguilar Santillana <mhpoin@gmail.com>"]
|
||||||
publish = false
|
publish = false
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
workspace = ".."
|
workspace = ".."
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
env_logger = "0.6"
|
env_logger = "0.7"
|
||||||
|
|
||||||
yarte = { version = "0.3", features=["with-actix-web"] }
|
yarte = { version = "0.3", features=["with-actix-web"] }
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# yarte
|
# 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
|
```bash
|
||||||
cargo test
|
cargo test
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
use yarte::recompile;
|
|
||||||
|
|
||||||
fn main() {
|
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 !}}
|
{{! Simple example !}}
|
||||||
{{> doc/t ~}}
|
{{> doc/t ~}}
|
||||||
<html>
|
<html>
|
||||||
{{~> doc/head title = "Actix web" ~}}
|
|
||||||
<body>
|
{{~> doc/head title = "Actix web" }}
|
||||||
{{~#if let Some(name) = query.get("name") }}
|
{{~> body ~}}
|
||||||
{{ let lastname = query.get("lastname").ok_or(yarte::Error)? }}
|
|
||||||
{{> card/hi ~}}
|
</html>
|
||||||
{{ else ~}}
|
|
||||||
{{> card/form ~}}
|
|
||||||
{{/if ~}}
|
|
||||||
</body></html>
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user