# blog is a dictionary mapping
-# (year, month, day) => [list of (filename, title, lead)]
+# (year, month, day) => [list of (file, title, lead)]
blog = {}
years = {}
titles.reverse()
save_day = None
- for year, month, day, filename, title, lead in titles:
+ for year, month, day, file, title, lead in titles:
href = []
if level == 0:
href.append(year)
href.append(month)
if level <= 2:
href.append(day)
- href.append(filename)
+ href.append(file)
href = '/'.join(href)
if day[0] == '0': day = day[1:]
if save_day <> day:
if level == 0:
years = {}
- for year, month, day, filename, title, lead in save_titles:
+ for year, month, day, file, title, lead in save_titles:
years[year] = True
first_year = True
new_text.append('''
day_titles = []
key = year, month, day
if key in blog:
- for filename, title, lead in blog[key]:
- if filename.endswith(".tmpl"):
- filename = filename[:-len("tmpl")] + "html"
- value = (year, month, day, filename, title, lead)
+ for file, title, lead in blog[key]:
+ if file.endswith(".tmpl"): file = file[:-len("tmpl")] + "html"
+ value = (year, month, day, file, title, lead)
all_titles.append(value)
year_titles.append(value)
month_titles.append(value)