From: Oleg Broytman Date: Wed, 8 Mar 2006 20:39:09 +0000 (+0000) Subject: Write lead and title in tags indices. X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=b4c1e4de6a50d04c81519eaf3dc440cca1e38da4;p=phdru.name%2Fphdru.name.git Write lead and title in tags indices. git-svn-id: file:///home/phd/archive/SVN/phdru.name/scripts@21 7bb0bf08-9e0d-0410-b083-99cee3bf18b8 --- diff --git a/reindex_blog.py b/reindex_blog.py index 44647bf..4451baa 100755 --- a/reindex_blog.py +++ b/reindex_blog.py @@ -279,7 +279,7 @@ for year in sorted(years.keys()): tag_links = all_tags[tag] else: tag_links = all_tags[tag] = [] - tag_links.append('/'.join(("..", year, month, day, file))) + tag_links.append(value) write_template(3, year, month, day, day_titles) write_template(2, year, month, day, month_titles) write_template(1, year, month, day, year_titles) @@ -324,9 +324,13 @@ for count, tag, links in all_tags: """ % (tag, tag, tag)] count = 0 - for link in reversed(links): - junk, year, month, day, filename = link.split('/') - item_text = """
  • %s/%s/%s: %s
  • """ % (link, year, month, day, filename) + for year, month, day, filename, title, lead in reversed(links): + if lead: + lead = lead + ' ' + else: + lead = '' + link = "../%s/%s/%s/%s" % (year, month, day, filename) + item_text = """
  • %s/%s/%s: %s%s
  • """ % (link, year, month, day, lead, title) count += 1 if count <= 5: