Mercurial > piecrust2
comparison piecrust/page.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 | aa6b7ff6a193 |
children | e7b865f8f335 |
comparison
equal
deleted
inserted
replaced
362:ff595828a364 | 363:dd25bd3ce1f9 |
---|---|
55 def ref_spec(self): | 55 def ref_spec(self): |
56 return '%s:%s' % (self.source.name, self.rel_path) | 56 return '%s:%s' % (self.source.name, self.rel_path) |
57 | 57 |
58 @cached_property | 58 @cached_property |
59 def path(self): | 59 def path(self): |
60 return self.source.resolveRef(self.rel_path) | 60 path, _ = self.source.resolveRef(self.rel_path) |
61 return path | |
61 | 62 |
62 @cached_property | 63 @cached_property |
63 def path_mtime(self): | 64 def path_mtime(self): |
64 return os.path.getmtime(self.path) | 65 return os.path.getmtime(self.path) |
65 | 66 |