# HG changeset patch # User Ludovic Chabant # Date 1424755160 28800 # Node ID 07b4b8484c0a38b40d1213469e1bc4a594565dd3 # Parent adb066ffb363ba2da172d2011392f25261836cf6 sources: Use `posts_*` and `items_*` settings more appropriately. The `items_*` settings are the generic ones, and the `posts_*` are only used with the default content model. diff -r adb066ffb363 -r 07b4b8484c0a piecrust/app.py --- a/piecrust/app.py Sun Feb 22 22:03:54 2015 -0800 +++ b/piecrust/app.py Mon Feb 23 21:19:20 2015 -0800 @@ -173,14 +173,6 @@ if not isinstance(sitec['themes_sources'], list): sitec['themes_sources'] = [sitec['themes_sources']] - # Setup values for posts/items. - ipp = sitec.get('posts_per_page') - if ipp is not None: - sitec.setdefault('items_per_page', ipp) - pf = sitec.get('posts_filters') - if pf is not None: - sitec.setdefault('items_filters', pf) - # Figure out if we need to validate sources/routes, or auto-generate # them from simple blog settings. orig_sources = sitec.get('sources') @@ -197,8 +189,8 @@ g_post_url = sitec.get('post_url', '%year%/%month%/%day%/%slug%') g_tag_url = sitec.get('tag_url', 'tag/%tag%') g_category_url = sitec.get('category_url', '%category%') - g_posts_per_page = sitec.get('items_per_page', 5) - g_posts_filters = sitec.get('items_filters') + g_posts_per_page = sitec.get('posts_per_page', 5) + g_posts_filters = sitec.get('posts_filters') g_date_format = sitec.get('date_format', DEFAULT_DATE_FORMAT) # The normal pages and tags/categories. diff -r adb066ffb363 -r 07b4b8484c0a piecrust/sources/mixins.py --- a/piecrust/sources/mixins.py Sun Feb 22 22:03:54 2015 -0800 +++ b/piecrust/sources/mixins.py Mon Feb 23 21:19:20 2015 -0800 @@ -66,7 +66,7 @@ def getPaginationFilter(self, page): conf = (page.config.get('items_filters') or - page.app.config.get('site/items_filters')) + self.config.get('items_filters')) if conf == 'none' or conf == 'nil' or conf == '': conf = None if conf is not None: