__revision__ = "$Id$"[5:-2]
__date__ = "$Date$"[7:-2]
__author__ = "Oleg Broytman <phd@phd.pp.ru>"
-__copyright__ = "Copyright (C) 2006 PhiloSoft Design"
+__copyright__ = "Copyright (C) 2006-2010 PhiloSoft Design"
import sys, os
#attr $Title = "Oleg Broytman's blog"
#attr $Description = "Broytman Russian Blog Index Document"
#attr $Copyright = %(cyear)s
-#attr $alternates = (("application/atom+xml", "News [Atom 1.0]", "atom_10.xml"),
- ("application/rss+xml", "News [RSS 2.0]", "rss_20.xml")
+#attr $alternates = (("News [Atom 1.0]", "application/atom+xml", "atom_10.xml"),
+ ("News [RSS 2.0]", "application/rss+xml", "rss_20.xml")
)
##
#def body_html
iday = int(day)
imonth = int(month)
- new_text.append("""\
-#attr $Next = "%s"
-""" % titles[0][3])
-
-
if len(titles) == 1:
new_text.append("""\
#attr $refresh = "0; URL=%s"
<dl>
"""]
-for count, tag, links in all_tags:
+for i, (count, tag, links) in enumerate(all_tags):
new_text.append("""\
<dt><a href="%s.html">%s (%d)</a></dt>
""" % (tag, tag, count))
+ first = all_tags[0][1]
+ if i == 0:
+ prev = None
+ else:
+ prev = all_tags[i-1][1]
+ if i >= len(all_tags)-1:
+ next = None
+ else:
+ next = all_tags[i+1][1]
+ last = all_tags[-1][1]
+
tag_text = ["""\
## THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
#extends phd_pp_ru
#implements respond
#attr $Title = "Oleg Broytman's blog: tag %s"
#attr $Description = "Broytman Russian Blog Tag %s Index Document"
+""" % (tag, tag)]
+
+ tag_text.append("""\
+#attr $First = "%s"
+""" % first)
+
+ if prev:
+ tag_text.append("""\
+#attr $Prev = "%s"
+""" % prev)
+
+ if next:
+ tag_text.append("""\
+#attr $Next = "%s"
+""" % next)
+
+ tag_text.append("""\
+#attr $Last = "%s"
+""" % last)
+
+ tag_text.append("""\
#attr $Copyright = 2006
##
#def body_html
<p class="head">
<ul>
-""" % (tag, tag, tag)]
+""" % tag)
count = 0
for year, month, day, filename, title, lead in reversed(links):