]> git.phdru.name Git - phdru.name/phdru.name.git/commitdiff
Write lead and title in tags indices.
authorOleg Broytman <phd@phdru.name>
Wed, 8 Mar 2006 20:39:09 +0000 (20:39 +0000)
committerOleg Broytman <phd@phdru.name>
Wed, 8 Mar 2006 20:39:09 +0000 (20:39 +0000)
git-svn-id: file:///home/phd/archive/SVN/phdru.name/scripts@21 7bb0bf08-9e0d-0410-b083-99cee3bf18b8

reindex_blog.py

index 44647bf7db270df9149f16a02bfecb5d620a038d..4451baa740e25f20b60be92b3699fc69e4ca2413 100755 (executable)
@@ -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 = """<li><a href="%s">%s/%s/%s: %s</a></li>""" % (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 = """<li><a href="%s">%s/%s/%s: %s%s</a></li>""" % (link, year, month, day, lead, title)
 
       count += 1
       if count <= 5: