shithub: hugo

Download patch

ref: ac26de205e93c104a62eb737128a75e9b6ee4a27
parent: d5518c09665c474a33bdf3872bde0dcefc0bf572
author: spf13 <[email protected]>
date: Sat Aug 10 11:41:10 EDT 2013

Adding correct canonical link to alias pages

--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -174,7 +174,7 @@
 }
 
 func (s *Site) primeTemplates() {
-	alias := "<!DOCTYPE html>\n <html>\n <head>\n <link rel=\"canonical\" href=\"{{ . }}\"/>\n <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n <meta http-equiv=\"refresh\" content=\"0;url={{ .Permalink }}\" />\n </head>\n </html>"
+	alias := "<!DOCTYPE html>\n <html>\n <head>\n <link rel=\"canonical\" href=\"{{ .Permalink }}\"/>\n <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n <meta http-equiv=\"refresh\" content=\"0;url={{ .Permalink }}\" />\n </head>\n </html>"
 
 	t := s.Tmpl.New("alias")
 	template.Must(t.Parse(alias))