Mercurial > piecrust2
comparison piecrust/baking/baker.py @ 363:dd25bd3ce1f9
serve: Refactoring and fixes to be able to serve taxonomy pages.
* Page sources' `findPagePath` is renamed to `findPageFactory`, so that it
also returns source metadata.
* Page refs now store possible hits more properly, and use the previous point
to also store metadata. As a result, they can also return a proper factory.
* Implement `findPageFactory` correctly in all built-in sources.
* When the Chef server matches a taxonomy page, get the source metadata from
the page ref in order to make a more proper page.
* Make the `getRoute(s)` functions explicitely say if they want taxonomy routes
or not.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 26 Apr 2015 15:07:40 -0700 |
parents | 938be93215cb |
children | 4b1019bb2533 |
comparison
equal
deleted
inserted
replaced
362:ff595828a364 | 363:dd25bd3ce1f9 |
---|---|
176 | 176 |
177 entry = BakeRecordPageEntry(fac.source.name, fac.rel_path, | 177 entry = BakeRecordPageEntry(fac.source.name, fac.rel_path, |
178 fac.path) | 178 fac.path) |
179 record.addEntry(entry) | 179 record.addEntry(entry) |
180 | 180 |
181 route = self.app.getRoute(source.name, fac.metadata) | 181 route = self.app.getRoute(source.name, fac.metadata, |
182 skip_taxonomies=True) | |
182 if route is None: | 183 if route is None: |
183 entry.errors.append( | 184 entry.errors.append( |
184 "Can't get route for page: %s" % fac.ref_spec) | 185 "Can't get route for page: %s" % fac.ref_spec) |
185 logger.error(entry.errors[-1]) | 186 logger.error(entry.errors[-1]) |
186 continue | 187 continue |