Mercurial > piecrust2
diff piecrust/data/paginationdata.py @ 729:e35407c60e00
templating: Make blog archives generator expose more templating data.
In addition to pagination data, also expose a non-paginating iterator that
lists all posts in a source by chronological order.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 01 Jun 2016 22:09:21 -0700 |
parents | d4408fbbbc7d |
children | bca06fc064c0 |
line wrap: on
line diff
--- a/piecrust/data/paginationdata.py Mon May 30 20:45:27 2016 -0700 +++ b/piecrust/data/paginationdata.py Wed Jun 01 22:09:21 2016 -0700 @@ -29,6 +29,7 @@ def _load(self): page = self._page + dt = page.datetime page_url = self._get_uri() _, slug = split_uri(page.app, page_url) self._setValue('url', page_url) @@ -36,6 +37,9 @@ self._setValue( 'timestamp', time.mktime(page.datetime.timetuple())) + self._setValue('datetime', { + 'year': dt.year, 'month': dt.month, 'day': dt.day, + 'hour': dt.hour, 'minute': dt.minute, 'second': dt.second}) date_format = page.app.config.get('site/date_format') if date_format: self._setValue('date', page.datetime.strftime(date_format))