Mercurial > piecrust2
changeset 244:ba857c693c72
sources: Fix a bug where the `posts` source wasn't correctly parsing URLs.
Don't crash when a component is missing from the URL and we have to recapture.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 19 Feb 2015 19:55:09 -0800 |
parents | 26e59f837558 |
children | 64184c9cf487 |
files | piecrust/sources/posts.py |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/piecrust/sources/posts.py Thu Feb 19 08:09:17 2015 -0800 +++ b/piecrust/sources/posts.py Thu Feb 19 19:55:09 2015 -0800 @@ -53,9 +53,9 @@ ext = self.default_auto_format replacements = { - 'year': '%04d' % year, - 'month': '%02d' % month, - 'day': '%02d' % day, + 'year': '%04d' % year if year is not None else None, + 'month': '%02d' % month if month is not None else None, + 'day': '%02d' % day if day is not None else None, 'slug': slug, 'ext': ext }