Browse Source

Add title and body to alias page (#830)

index-subcmd
Laurent Arnoud Vincent Prouillet 5 years ago
parent
commit
aaaed31f9c
2 changed files with 14 additions and 0 deletions
  1. +10
    -0
      components/site/tests/site.rs
  2. +4
    -0
      components/templates/src/builtins/internal/alias.html

+ 10
- 0
components/site/tests/site.rs View File

@@ -470,6 +470,16 @@ fn can_build_site_with_pagination_for_index() {
"page/1/index.html", "page/1/index.html",
"http-equiv=\"refresh\" content=\"0;url=https://replace-this-with-your-url.com/\"" "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", "Num pages: 1"));
assert!(file_contains!(public, "index.html", "Current index: 1")); assert!(file_contains!(public, "index.html", "Current index: 1"));
assert!(file_contains!(public, "index.html", "First: https://replace-this-with-your-url.com/")); assert!(file_contains!(public, "index.html", "First: https://replace-this-with-your-url.com/"));


+ 4
- 0
components/templates/src/builtins/internal/alias.html View File

@@ -1,8 +1,12 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>Redirect</title>
<link rel="canonical" href="{{ url | safe }}" /> <link rel="canonical" href="{{ url | safe }}" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="0;url={{ url | safe }}" /> <meta http-equiv="refresh" content="0;url={{ url | safe }}" />
</head> </head>
<body>
<p><a href="{{ url | safe }}">Click here</a> to be redirected.</p>
</body>
</html> </html>

Loading…
Cancel
Save