comparison piecrust/app.py @ 230:016d42c23ba9

internal: Make the simple page source use `slug` everywhere. Before, it would use `slug` in some places, and `path` in other places, which would be quite confusing.
author Ludovic Chabant <ludovic@chabant.com>
date Wed, 11 Feb 2015 08:29:09 -0800
parents 7decf00eee47
children da5e6e00fb41
comparison
equal deleted inserted replaced
229:a951cd4ef361 230:016d42c23ba9
24 24
25 25
26 logger = logging.getLogger(__name__) 26 logger = logging.getLogger(__name__)
27 27
28 28
29 CACHE_VERSION = 14 29 CACHE_VERSION = 15
30 30
31 31
32 class VariantNotFoundError(Exception): 32 class VariantNotFoundError(Exception):
33 def __init__(self, variant_path, message=None): 33 def __init__(self, variant_path, message=None):
34 super(VariantNotFoundError, self).__init__( 34 super(VariantNotFoundError, self).__init__(
197 'item_name': 'page'} 197 'item_name': 'page'}
198 sitec['sources'] = sourcesc 198 sitec['sources'] = sourcesc
199 199
200 routesc = [] 200 routesc = []
201 routesc.append({ 201 routesc.append({
202 'url': '/%path:path%', 202 'url': '/%path:slug%',
203 'source': 'pages', 203 'source': 'pages',
204 'func': 'pcurl(path)'}) 204 'func': 'pcurl(slug)'})
205 sitec['routes'] = routesc 205 sitec['routes'] = routesc
206 206
207 taxonomiesc = collections.OrderedDict() 207 taxonomiesc = collections.OrderedDict()
208 taxonomiesc['tags'] = { 208 taxonomiesc['tags'] = {
209 'multiple': True, 209 'multiple': True,
300 'fs_endpoint': 'pages', 300 'fs_endpoint': 'pages',
301 'data_endpoint': 'site/pages', 301 'data_endpoint': 'site/pages',
302 'item_name': 'page', 302 'item_name': 'page',
303 'realm': REALM_THEME} 303 'realm': REALM_THEME}
304 sitec['routes'].append({ 304 sitec['routes'].append({
305 'url': '/%path:path%', 305 'url': '/%path:slug%',
306 'source': 'theme_pages', 306 'source': 'theme_pages',
307 'func': 'pcurl(path)'}) 307 'func': 'pcurl(slug)'})
308 308
309 # Sources have the `default` scanner by default, duh. Also, a bunch 309 # Sources have the `default` scanner by default, duh. Also, a bunch
310 # of other default values for other configuration stuff. 310 # of other default values for other configuration stuff.
311 for sn, sc in sourcesc.items(): 311 for sn, sc in sourcesc.items():
312 if not isinstance(sc, dict): 312 if not isinstance(sc, dict):