Mercurial > piecrust2
changeset 260:07b4b8484c0a
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.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Mon, 23 Feb 2015 21:19:20 -0800 |
parents | adb066ffb363 |
children | b51ddb0c260b |
files | piecrust/app.py piecrust/sources/mixins.py |
diffstat | 2 files changed, 3 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- 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.
--- 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: