-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #141 from kaj/fix-recursive-template
Document workaround for #134
- Loading branch information
Showing
8 changed files
with
82 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@use super::base_html; | ||
|
||
@(title: &str, content: Content, meta: Content) | ||
|
||
@:base_html(title, { | ||
<div> | ||
@:content() | ||
</div> | ||
<footer>A footer common to some pages.</footer> | ||
}, { | ||
@:meta() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@use super::statics::*; | ||
@use crate::footer; | ||
|
||
@(title: &str, htmlargs: Content, content: Content) | ||
|
||
<!doctype html> | ||
<html lang="en"@:htmlargs()> | ||
<head> | ||
<title>@title</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"/> | ||
<link rel="stylesheet" type="text/css" href="/static/@style_css.name"/> | ||
</head> | ||
<body> | ||
<main> | ||
<h1>@title</h1> | ||
|
||
@:content() | ||
</main> | ||
@:footer() | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,10 @@ | ||
@use super::statics::*; | ||
@use crate::footer; | ||
@use super::intermediate_html; | ||
@use warp::http::StatusCode; | ||
|
||
@(code: StatusCode, message: &str) | ||
|
||
<!doctype html> | ||
<html lang="en" class="error"> | ||
<head> | ||
<title>Error @code.as_u16(): @code.canonical_reason().unwrap_or("error")</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"/> | ||
<link rel="stylesheet" type="text/css" href="/static/@style_css.name"/> | ||
</head> | ||
<body> | ||
<main> | ||
<h1>@code.canonical_reason().unwrap_or("error")</h1> | ||
|
||
<p>@message</p> | ||
<p>We are sorry about this. | ||
In a real application, this would mention the incident having | ||
been logged, and giving contact details for further reporting.</p> | ||
</main> | ||
@:footer() | ||
</body> | ||
</html> | ||
@:intermediate_html(code.canonical_reason().unwrap_or("Error"), { class="error"}, { | ||
<p>@message</p> | ||
<p>We are sorry about this. | ||
In a real application, this would mention the incident having | ||
been logged, and giving contact details for further reporting.</p> | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@use super::base_html; | ||
|
||
@(title: &str, htmlargs: Content, content: Content) | ||
@:base_html(title, {@:htmlargs()}, { | ||
@:content() | ||
<p>This whole site is an example.</p> | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters