return tmpl
+all_years = {}
all_titles = []
for key in sorted(blog.keys()):
+ year, month, day = key
+ if year in all_years:
+ year_d = all_years[year]
+ else:
+ all_years[year] = year_d = {}
+ if month in year_d:
+ days_of_month = year_d[month]
+ else:
+ year_d[month] = days_of_month = []
+ d = os.path.join(year, month, day)
+ days_of_month.append(d)
title, tmpl, lead = blog[key]
all_titles.append((key, translate(tmpl), title, lead))
all_titles = all_titles[-20:]
+
for year in sorted(years.keys()):
year_titles = []
- months = years[year]
+ months = all_years[year]
for month in sorted(months.keys()):
month_titles = []
for day in sorted(months[month]):