Mercurial > piecrust2
comparison piecrust/processing/sitemap.py @ 147:ab6e7e0e9d44
Pass date information to routing when building URLs.
This is so that URLs with dates in them can be built even when the date
information is not coming from the source metadata, but from the page's
config.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sat, 29 Nov 2014 21:00:44 -0800 |
parents | 371a6c879ab9 |
children | 1c4078ec3011 |
comparison
equal
deleted
inserted
replaced
146:0609739169bd | 147:ab6e7e0e9d44 |
---|---|
65 if source is None: | 65 if source is None: |
66 raise Exception("No such source: %s" % name) | 66 raise Exception("No such source: %s" % name) |
67 | 67 |
68 for page in source.getPages(): | 68 for page in source.getPages(): |
69 route = self.app.getRoute(source.name, page.source_metadata) | 69 route = self.app.getRoute(source.name, page.source_metadata) |
70 uri = route.getUri(page.source_metadata) | 70 uri = route.getUri(page.source_metadata, page) |
71 | 71 |
72 t = page.datetime.timestamp() | 72 t = page.datetime.timestamp() |
73 sm_cfg = page.config.get('sitemap') | 73 sm_cfg = page.config.get('sitemap') |
74 | 74 |
75 args = {'url': uri, 'lastmod': strftime_iso8601(t)} | 75 args = {'url': uri, 'lastmod': strftime_iso8601(t)} |