Fix periods in taxonomies create bad paths
authorRyan Clarke <ryan@ryanclarke.net>
Tue, 2 Jun 2015 00:29:29 +0000 (20:29 -0400)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 25 Jul 2015 19:43:20 +0000 (21:43 +0200)
Fixes #1188

hugolib/site.go

index fd08c415ba87dfc5cef097be924e37ca0301a41d..4457e1050f10fc2b0902950a3c53cb110e132dd2 100644 (file)
@@ -1095,7 +1095,14 @@ func taxonomyRenderer(s *Site, taxes <-chan taxRenderInfo, results chan<- error,
 
                n, base = s.newTaxonomyNode(t)
 
-               if err := s.renderAndWritePage("taxonomy "+t.singular, base, n, layouts...); err != nil {
+               dest := base
+               if viper.GetBool("UglyURLs") {
+                       dest = helpers.Uglify(base + ".html")
+               } else {
+                       dest = helpers.PrettifyPath(base + "/index.html")
+               }
+
+               if err := s.renderAndWritePage("taxonomy "+t.singular, dest, n, layouts...); err != nil {
                        results <- err
                        continue
                }