diff --git a/hugolib/site.go b/hugolib/site.go index 2f565f8db..517c82dc3 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -184,9 +184,13 @@ func (s *Site) generateTemplateNameFrom(path string) (name string) { func (s *Site) primeTemplates() { alias := "\n \n \n \n \n \n \n " + alias_xhtml := "\n \n \n \n \n \n \n " t := s.Tmpl.New("alias") template.Must(t.Parse(alias)) + + t = s.Tmpl.New("alias-xhtml") + template.Must(t.Parse(alias_xhtml)) } func (s *Site) initialize() { @@ -415,7 +419,11 @@ func inStringArray(arr []string, el string) bool { func (s *Site) RenderAliases() error { for i, p := range s.Pages { for _, a := range p.Aliases { - content, err := s.RenderThing(s.Pages[i], "alias") + t := "alias"; + if strings.HasSuffix(a, ".xhtml") { + t = "alias-xhtml" + } + content, err := s.RenderThing(s.Pages[i], t) if strings.HasSuffix(a, "/") { a = a + "index.html" }