mirror of
https://github.com/actix/examples
synced 2025-06-29 02:10:36 +02:00
Add template yarte
This commit is contained in:
1
template_yarte/templates/deep/more/deep/welcome.hbs
Normal file
1
template_yarte/templates/deep/more/deep/welcome.hbs
Normal file
@ -0,0 +1 @@
|
||||
<{{ tag }}>Welcome!</{{ tag }}>
|
22
template_yarte/templates/index.hbs
Normal file
22
template_yarte/templates/index.hbs
Normal file
@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Actix web</title>
|
||||
</head>
|
||||
<body>
|
||||
{{~#if let Some(name) = query.get("name") ~}}
|
||||
<h1>Hi, {{ name }}!</h1>
|
||||
{{~> alias/welcome tag='p' ~}}
|
||||
{{~ else ~}}
|
||||
{{~> alias/welcome tag="h1" ~}}
|
||||
<p>
|
||||
<h3>What is your name?</h3>
|
||||
<form>
|
||||
<input type="text" name="name"/><br/>
|
||||
<p><input type="submit"></p>
|
||||
</form>
|
||||
</p>
|
||||
{{~/if~}}
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user