diff piecrust/sources/blogarchives.py @ 1047:ba809c221a27

data: Properly order month names in blog archives.
author Ludovic Chabant <ludovic@chabant.com>
date Fri, 26 Jan 2018 18:00:04 -0800
parents 8adc27285d93
children 5f97b5b59dfe
line wrap: on
line diff
--- a/piecrust/sources/blogarchives.py	Tue Jan 23 08:54:58 2018 -0800
+++ b/piecrust/sources/blogarchives.py	Fri Jan 26 18:00:04 2018 -0800
@@ -121,9 +121,10 @@
             posts_this_month.append(page.content_item)
 
         self._months = []
-        for m, ptm in month_index.items():
+        for m in sorted(month_index.keys()):
             timestamp = time.mktime((self._year, m, 1, 0, 0, 0, 0, 0, -1))
 
+            ptm = month_index[m]
             it = PageIterator(ListSource(self._inner_source, ptm))
             it._wrapAsSort(DateSortIterator, reverse=False)