hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 5d3aabcb32f33715eddb378f12541c7c412ee261
parent 75deb923d9feb8a2d92b2ed25af7426af6e7cc21
Author: Marvin Pinto <git@pinto.im>
Date:   Mon,  7 Mar 2016 15:05:51 -0500

Update the alias generated HTML files to conform to the W3C HTML spec

- W3C recommends that there be a [whitespace character][1] between the
`;` and the `url=` portions.

- W3C also recommends that there be a [title][2] child in the `head`
element

[1]: https://www.w3.org/TR/html-markup/meta.http-equiv.refresh.html
[2]: https://www.w3.org/TR/html-markup/head.html

Closes #1933

Diffstat:
Mdocs/content/extras/aliases.md | 3++-
Mtarget/htmlredirect.go | 4++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/docs/content/extras/aliases.md b/docs/content/extras/aliases.md
@@ -72,9 +72,10 @@ Assuming a baseurl of `mysite.tld`, the contents of the html file will look some
 <!DOCTYPE html>
 <html>
   <head>
+    <title>http://mysite.tld/posts/my-original-url</title>
     <link rel="canonical" href="http://mysite.tld/posts/my-original-url"/>
     <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
-    <meta http-equiv="refresh" content="0;url=http://mysite.tld/posts/my-original-url"/>
+    <meta http-equiv="refresh" content="0; url=http://mysite.tld/posts/my-original-url"/>
   </head>
 </html>
 ```
diff --git a/target/htmlredirect.go b/target/htmlredirect.go
@@ -26,8 +26,8 @@ import (
 	jww "github.com/spf13/jwalterweatherman"
 )
 
-const alias = "<!DOCTYPE html><html><head><link rel=\"canonical\" href=\"{{ .Permalink }}\"/><meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" /><meta http-equiv=\"refresh\" content=\"0;url={{ .Permalink }}\" /></head></html>"
-const aliasXHtml = "<!DOCTYPE html><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><link rel=\"canonical\" href=\"{{ .Permalink }}\"/><meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" /><meta http-equiv=\"refresh\" content=\"0;url={{ .Permalink }}\" /></head></html>"
+const alias = "<!DOCTYPE html><html><head><title>{{ .Permalink }}</title><link rel=\"canonical\" href=\"{{ .Permalink }}\"/><meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" /><meta http-equiv=\"refresh\" content=\"0; url={{ .Permalink }}\" /></head></html>"
+const aliasXHtml = "<!DOCTYPE html><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><title>{{ .Permalink }}</title><link rel=\"canonical\" href=\"{{ .Permalink }}\"/><meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" /><meta http-equiv=\"refresh\" content=\"0; url={{ .Permalink }}\" /></head></html>"
 
 var defaultAliasTemplates *template.Template