changeset 320:edcc9dc17b37

config: Assign correct data endpoint for blogs to be v1-compatible.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 28 Mar 2015 14:25:59 -0700
parents 50da3a045d59
children 59d65654184e
files piecrust/app.py
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/piecrust/app.py	Sat Mar 28 14:25:33 2015 -0700
+++ b/piecrust/app.py	Sat Mar 28 14:25:59 2015 -0700
@@ -221,18 +221,21 @@
             for blog_name in blogsc:
                 blogc = values.get(blog_name, {})
                 url_prefix = blog_name + '/'
-                endpoint = 'posts/%s' % blog_name
+                fs_endpoint = 'posts/%s' % blog_name
+                data_endpoint = blog_name
                 item_name = '%s-post' % blog_name
                 items_per_page = blogc.get('posts_per_page', g_posts_per_page)
                 items_filters = blogc.get('posts_filters', g_posts_filters)
                 date_format = blogc.get('date_format', g_date_format)
                 if len(blogsc) == 1:
                     url_prefix = ''
-                    endpoint = 'posts'
+                    fs_endpoint = 'posts'
+                    data_endpoint = 'blog'
                     item_name = 'post'
                 sourcesc[blog_name] = {
                         'type': 'posts/%s' % posts_fs,
-                        'fs_endpoint': endpoint,
+                        'fs_endpoint': fs_endpoint,
+                        'data_endpoint': data_endpoint,
                         'ignore_missing_dir': True,
                         'data_type': 'blog',
                         'item_name': item_name,