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:
8
template_yarte/templates/base.hbs
Normal file
8
template_yarte/templates/base.hbs
Normal file
@ -0,0 +1,8 @@
|
||||
{{! Simple example !}}
|
||||
{{> doc/t }}
|
||||
<html>
|
||||
{{> doc/head }}
|
||||
<body>
|
||||
{{> @partial-block }}
|
||||
</body>
|
||||
</html>
|
@ -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>
|
@ -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>
|
||||
|
@ -1 +1,4 @@
|
||||
<head><meta charset="utf-8" /><title>{{ title }}</title></head>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>{{ title }}</title>
|
||||
</head>
|
||||
|
@ -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 }}
|
||||
|
Reference in New Issue
Block a user