diff piecrust/baking/single.py @ 262:61145dcd56e0

routing: Better generate URLs according to the site configuration. This fixes problems now that even the chef server generates URLs that are appropriate given the `pretty_urls` and `trailing_slash` settings. Add some tests.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 24 Feb 2015 08:06:25 -0800
parents da5e6e00fb41
children 74bea91c9630
line wrap: on
line diff
--- a/piecrust/baking/single.py	Tue Feb 24 08:04:49 2015 -0800
+++ b/piecrust/baking/single.py	Tue Feb 24 08:06:25 2015 -0800
@@ -39,14 +39,10 @@
         if self.pretty_urls:
             bake_path.append(decoded_uri)
             bake_path.append('index.html')
+        elif decoded_uri == '':
+            bake_path.append('index.html')
         else:
-            name, ext = os.path.splitext(decoded_uri)
-            if decoded_uri == '':
-                bake_path.append('index.html')
-            elif ext:
-                bake_path.append(decoded_uri)
-            else:
-                bake_path.append(decoded_uri + '.html')
+            bake_path.append(decoded_uri)
 
         return os.path.normpath(os.path.join(*bake_path))