mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
Adding correct canonical link to alias pages
This commit is contained in:
@@ -174,7 +174,7 @@ func (s *Site) loadTemplates() {
|
||||
}
|
||||
|
||||
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))
|
||||
|
Reference in New Issue
Block a user