Mercurial > piecrust2
comparison piecrust/dataproviders/blog.py @ 905:1d0364614665
internal: Sources can cache their pages in addition to their items.
Added `getAllPages` to content sources to prevent having to look up cached
page objects in the page repository all the time.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 23 Jul 2017 08:26:57 -0700 |
parents | f4608e2e80ce |
children | 45ad976712ec |
comparison
equal
deleted
inserted
replaced
904:cc2647360036 | 905:1d0364614665 |
---|---|
85 for tn in tax_names: | 85 for tn in tax_names: |
86 tax_cfg = self._app.config.get('site/taxonomies/' + tn) | 86 tax_cfg = self._app.config.get('site/taxonomies/' + tn) |
87 taxonomies.append(Taxonomy(tn, tax_cfg)) | 87 taxonomies.append(Taxonomy(tn, tax_cfg)) |
88 tax_index[tn] = {} | 88 tax_index[tn] = {} |
89 | 89 |
90 app = self._app | |
91 page = self._page | 90 page = self._page |
92 source = self._sources[0] | 91 source = self._sources[0] |
93 | 92 |
94 for item in source.getAllContents(): | 93 for post in source.getAllPages(): |
95 post = app.getPage(source, item) | |
96 post_dt = post.datetime | 94 post_dt = post.datetime |
97 | 95 |
98 year = post_dt.year | 96 year = post_dt.year |
99 month = (post_dt.month, post_dt.year) | 97 month = (post_dt.month, post_dt.year) |
100 | 98 |