Mercurial > piecrust2
diff 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 |
line wrap: on
line diff
--- a/piecrust/appconfig.py Mon Sep 05 22:30:05 2016 -0700 +++ b/piecrust/appconfig.py Wed Sep 07 08:58:41 2016 -0700 @@ -285,7 +285,7 @@ }), 'routes': [ { - 'url': '/%path:slug%', + 'url': '/%slug%', 'source': 'theme_pages', 'func': 'pcurl' } @@ -337,9 +337,9 @@ 'posts_fs': DEFAULT_POSTS_FS, 'default_page_layout': 'default', 'default_post_layout': 'post', - 'post_url': '/%int4:year%/%int2:month%/%int2:day%/%slug%', - 'year_url': '/archives/%int4:year%', - 'tag_url': '/tag/%+tag%', + 'post_url': '/%year%/%month%/%day%/%slug%', + 'year_url': '/archives/%year%', + 'tag_url': '/tag/%tag%', 'category_url': '/%category%', 'posts_per_page': 5 }) @@ -363,7 +363,7 @@ }), 'routes': [ { - 'url': '/%path:slug%', + 'url': '/%slug%', 'source': 'pages', 'func': 'pcurl' }