Skip to content

Commit

Permalink
Add title and body to alias page (#830)
Browse files Browse the repository at this point in the history
  • Loading branch information
spk authored and Keats committed Oct 28, 2019
1 parent 0cd047b commit 83363d8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions components/site/tests/site.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,16 @@ fn can_build_site_with_pagination_for_index() {
"page/1/index.html",
"http-equiv=\"refresh\" content=\"0;url=https://replace-this-with-your-url.com/\""
));
assert!(file_contains!(
public,
"page/1/index.html",
"<title>Redirect</title>"
));
assert!(file_contains!(
public,
"page/1/index.html",
"<a href=\"https://replace-this-with-your-url.com/\">Click here</a>"
));
assert!(file_contains!(public, "index.html", "Num pages: 1"));
assert!(file_contains!(public, "index.html", "Current index: 1"));
assert!(file_contains!(public, "index.html", "First: https://replace-this-with-your-url.com/"));
Expand Down
4 changes: 4 additions & 0 deletions components/templates/src/builtins/internal/alias.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<title>Redirect</title>
<link rel="canonical" href="{{ url | safe }}" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="0;url={{ url | safe }}" />
</head>
<body>
<p><a href="{{ url | safe }}">Click here</a> to be redirected.</p>
</body>
</html>

0 comments on commit 83363d8

Please sign in to comment.