comparison piecrust/appconfig.py @ 792:58ebf50235a5

routing: Simplify how routes are defined. * No more declaring the type of route parameters -- the sources and generators already know what type each parameter is supposed to be. * Same for variadic parameters -- we know already. * Update cache version to force a clear reload of the config. * Update tests. TODO: simplify code in the `Route` class to use source or generator transparently.
author Ludovic Chabant <ludovic@chabant.com>
date Wed, 07 Sep 2016 08:58:41 -0700
parents f6f9a284a5f3
children fd694f1297c7
comparison
equal deleted inserted replaced
791:504d6817352d 792:58ebf50235a5
283 'realm': REALM_THEME 283 'realm': REALM_THEME
284 } 284 }
285 }), 285 }),
286 'routes': [ 286 'routes': [
287 { 287 {
288 'url': '/%path:slug%', 288 'url': '/%slug%',
289 'source': 'theme_pages', 289 'source': 'theme_pages',
290 'func': 'pcurl' 290 'func': 'pcurl'
291 } 291 }
292 ], 292 ],
293 'theme_tag_page': 'theme_pages:_tag.%ext%', 293 'theme_tag_page': 'theme_pages:_tag.%ext%',
335 default_content_model_base = collections.OrderedDict({ 335 default_content_model_base = collections.OrderedDict({
336 'site': collections.OrderedDict({ 336 'site': collections.OrderedDict({
337 'posts_fs': DEFAULT_POSTS_FS, 337 'posts_fs': DEFAULT_POSTS_FS,
338 'default_page_layout': 'default', 338 'default_page_layout': 'default',
339 'default_post_layout': 'post', 339 'default_post_layout': 'post',
340 'post_url': '/%int4:year%/%int2:month%/%int2:day%/%slug%', 340 'post_url': '/%year%/%month%/%day%/%slug%',
341 'year_url': '/archives/%int4:year%', 341 'year_url': '/archives/%year%',
342 'tag_url': '/tag/%+tag%', 342 'tag_url': '/tag/%tag%',
343 'category_url': '/%category%', 343 'category_url': '/%category%',
344 'posts_per_page': 5 344 'posts_per_page': 5
345 }) 345 })
346 }) 346 })
347 347
361 'item_name': 'page' 361 'item_name': 'page'
362 } 362 }
363 }), 363 }),
364 'routes': [ 364 'routes': [
365 { 365 {
366 'url': '/%path:slug%', 366 'url': '/%slug%',
367 'source': 'pages', 367 'source': 'pages',
368 'func': 'pcurl' 368 'func': 'pcurl'
369 } 369 }
370 ], 370 ],
371 'taxonomies': collections.OrderedDict([ 371 'taxonomies': collections.OrderedDict([