comparison piecrust/uriutil.py @ 852:4850f8c21b6e

core: Start of the big refactor for PieCrust 3.0. * Everything is a `ContentSource`, including assets directories. * Most content sources are subclasses of the base file-system source. * A source is processed by a "pipeline", and there are 2 built-in pipelines, one for assets and one for pages. The asset pipeline is vaguely functional, but the page pipeline is completely broken right now. * Rewrite the baking process as just running appropriate pipelines on each content item. This should allow for better parallelization.
author Ludovic Chabant <ludovic@chabant.com>
date Wed, 17 May 2017 00:11:48 -0700
parents e85f29b28b84
children e1b33cbf9874
comparison
equal deleted inserted replaced
851:2c7e57d80bba 852:4850f8c21b6e
1 import re 1 import re
2 import os.path 2 import os.path
3 import string
4 import logging 3 import logging
5 4
6 5
7 logger = logging.getLogger(__name__) 6 logger = logging.getLogger(__name__)
8 7
55 elif trailing_slash: 54 elif trailing_slash:
56 uri += '/' 55 uri += '/'
57 56
58 return uri, page_num 57 return uri, page_num
59 58
59
60 def uri_to_title(slug):
61 slug = re.sub(r'[\-_]', ' ', slug)
62 return slug.title()
63