1
0
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:
Juan Aguilar 2019-11-19 10:56:19 +01:00 committed by Yuki Okushi
parent dc6e1cc762
commit 663f8a64a8
5 changed files with 20 additions and 16 deletions

View File

@ -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"] }

View File

@ -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

View File

@ -1,5 +1,3 @@
use yarte::recompile;
fn main() {
recompile::when_changed();
yarte::recompile::when_changed();
}

View 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>

View File

@ -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>