X-Git-Url: https://git.phdru.name/?p=phdru.name%2Fphdru.name.git;a=blobdiff_plain;f=reindex_blog.py;h=0ba0804d4c1d458628744a4c9d8ba5f6c2781744;hp=5c14d4693590138f44db0fe794b8f95ca8339e39;hb=251dd1739e176805010998623456b6672283159e;hpb=3cb0903ad684d4dcdd70adb6b3b0f4ea2c2056ee
diff --git a/reindex_blog.py b/reindex_blog.py
index 5c14d46..0ba0804 100755
--- a/reindex_blog.py
+++ b/reindex_blog.py
@@ -334,17 +334,49 @@ new_text = ["""\
"""]
-for count, tag, links in all_tags:
+for i, (count, tag, links) in enumerate(all_tags):
new_text.append("""\
- %s (%d)
""" % (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
@@ -352,7 +384,7 @@ for count, tag, links in all_tags:
-""" % (tag, tag, tag)]
+""" % tag)
count = 0
for year, month, day, filename, title, lead in reversed(links):