diff piecrust/templating/jinjaengine.py @ 352:498a917cd2d4

pagination: Make pagination use routes to generate proper URLs. This fixes incorrect URLs when using custom sub-page suffixes, for instance. Add tests.
author Ludovic Chabant <ludovic@chabant.com>
date Fri, 17 Apr 2015 16:09:30 -0700
parents 938be93215cb
children 019d274e6713
line wrap: on
line diff
--- a/piecrust/templating/jinjaengine.py	Fri Apr 17 16:08:23 2015 -0700
+++ b/piecrust/templating/jinjaengine.py	Fri Apr 17 16:09:30 2015 -0700
@@ -179,9 +179,9 @@
             raise Exception("Can't paginate when no page has been pushed "
                             "on the execution stack.")
         first_uri, _ = split_sub_uri(self.app, cpi.render_ctx.uri)
-        return Paginator(cpi.page, value, first_uri,
-                page_num=cpi.render_ctx.page_num,
-                items_per_page=items_per_page)
+        return Paginator(cpi.page, value,
+                         page_num=cpi.render_ctx.page_num,
+                         items_per_page=items_per_page)
 
     def _formatWith(self, value, format_name):
         return format_text(self.app, format_name, value)