]> git.phdru.name Git - phdru.name/phdru.name.git/commitdiff
Link to tag(s) in an every tagged post.
authorOleg Broytman <phd@phdru.name>
Sat, 8 Apr 2006 21:40:19 +0000 (21:40 +0000)
committerOleg Broytman <phd@phdru.name>
Sat, 8 Apr 2006 21:40:19 +0000 (21:40 +0000)
git-svn-id: file:///home/phd/archive/SVN/phdru.name/scripts@48 7bb0bf08-9e0d-0410-b083-99cee3bf18b8

phd_pp_ru.tmpl
reindex_blog.py

index 10da99f6577eb17c9befb4223f35f09eb1dc9c88..d78f55db41f8f9ba5b9a3b354e1c70ffed2dfd1c 100644 (file)
@@ -13,6 +13,7 @@
 #attr $last_modified_ru = time.strftime("%d.%m.%Y в %T", time.localtime())
 #attr $styles = None
 #attr $alternates = None
+#attr $Tag = None
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
 <html>
@@ -68,10 +69,33 @@ $style
 <body bgcolor="#CCCCCC" text="#000000"
       link="#0000bb"  vlink="#551a8b" alink="#ff0000">
 $body
+#def link_tag($tag)
+<a href="../../../tags/${tag}.html">$tag</a>
+#end def
+#if $Tag
+<hr width="90%">
+#if isinstance($Tag, basestring)
+#if $path.startswith("/Russian/")
+Тег:
+#else
+Tag:
+#end if
+$link_tag($Tag)
+#else
+#if $path.startswith("/Russian/")
+Теги:
+#else
+Tags:
+#end if
+#for $tag in $Tag
+$link_tag($tag)
+#end for
+#end if
+#end if
+<hr width="90%">
 #if $path.endswith("index.html")
 #set $path = $path[:-len("index.html")]
 #end if
-<hr width="90%">
 #if $path.startswith("/Russian/")
 <p class="head" style="font-size: 60%">Эта страница <a href="http://phd.pp.ru$path">http://phd.pp.ru$path</a>
 была сгенерирована $last_modified_ru из шаблона CheetahTemplate <a href="$_fileBaseName">$_fileBaseName</a>;
index f6505421239d531233636126b7f9ad1a91da68cb..4be9689896774ea21d0d813379f6bdbb0dd93d3f 100755 (executable)
@@ -53,7 +53,7 @@ for dirpath, dirs, files in os.walk(blog_root):
       title = ' '.join(title_parts[6:])
       lead = getattr(template, "Lead", None)
 
-      tags = getattr(template, "Tag", None)
+      tags = template.Tag
       if isinstance(tags, basestring):
          tags = (tags,)