1
0
mirror of https://github.com/actix/examples synced 2025-06-29 02:10:36 +02:00

Update yarte version to 0.6.0 and his templates with partial block and html minifier new features (#251)

This commit is contained in:
Juan Aguilar
2020-02-06 18:19:04 +01:00
committed by GitHub
parent 443b8197ed
commit 7198fa31e9
7 changed files with 84 additions and 28 deletions

View File

@ -0,0 +1,8 @@
{{! Simple example !}}
{{> doc/t }}
<html>
{{> doc/head }}
<body>
{{> @partial-block }}
</body>
</html>

View File

@ -1,10 +0,0 @@
<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

@ -9,12 +9,11 @@
{{! Form !}}
<form>
{{! Input name !}}
Name: <input type="text" name="name" />
Name: <input type="text" name="name" /><br/>
{{! Input last name !}}
<br/>Last name: <input type="text" name="lastname" />
{{! Submit !}}
<br/><p><input type="submit"></p></form>
{{! Order and remove whitespace with comments !}}
Last name: <input type="text" name="lastname"/><br/>
<p>
<input type="submit">
</p>
</form>
</div>

View File

@ -1 +1,4 @@
<head><meta charset="utf-8" /><title>{{ title }}</title></head>
<head>
<meta charset="utf-8"/>
<title>{{ title }}</title>
</head>

View File

@ -1,8 +1,8 @@
{{! Simple example !}}
{{> doc/t ~}}
<html>
{{~> doc/head title = "Actix web" }}
{{~> body ~}}
</html>
{{#> base title = "Actix web" }}
{{~#if let Some(name) = query.get("name") }}
{{ let lastname = query.get("lastname").ok_or(yarte::Error)? }}
{{> card/hi ~}}
{{ else ~}}
{{> card/form ~}}
{{/if ~}}
{{/base }}