##
#def body_html
<H1>Теги</H1>
+
+<p class="head">
+<dl>
"""]
for count, tag, links in all_tags:
- new_text.append("""
-<p class="head"><a href="%s.html">%s (%d)</a></p>
+ new_text.append("""\
+ <dt><a href="%s.html">%s (%d)</a></dt>
""" % (tag, tag, count))
tag_text = ["""\
##
#def body_html
<H1>%s</H1>
+
+<p class="head">
+<ul>
""" % (tag, tag, tag)]
- for link in links:
+ count = 0
+ for link in reversed(links):
junk, year, month, day, filename = link.split('/')
- tag_text.append("""
-<p class="head"><a href="%s">%s/%s/%s: %s</a></p>
-""" % (link, year, month, day, filename))
+ item_text = """<li><a href="%s">%s/%s/%s: %s</a></li>""" % (link, year, month, day, filename)
+
+ count += 1
+ if count <= 5:
+ new_text.append(" <dd>%s</dd>\n" % item_text)
+
+ tag_text.append(" %s\n" % item_text)
tag_text.append("""\
+</ul>
+</p>
#end def
$phd_pp_ru.respond(self)
""")
write_if_changed(os.path.join("tags", tag+".tmpl"), ''.join(tag_text))
new_text.append("""\
+</dl>
+</p>
#end def
$phd_pp_ru.respond(self)
""")