From 3da613ba24262aa407189a733e5c2435baff224b Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 8 Apr 2006 21:40:19 +0000 Subject: [PATCH] Link to tag(s) in an every tagged post. git-svn-id: file:///home/phd/archive/SVN/phdru.name/scripts@48 7bb0bf08-9e0d-0410-b083-99cee3bf18b8 --- phd_pp_ru.tmpl | 26 +++++++++++++++++++++++++- reindex_blog.py | 2 +- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/phd_pp_ru.tmpl b/phd_pp_ru.tmpl index 10da99f..d78f55d 100644 --- a/phd_pp_ru.tmpl +++ b/phd_pp_ru.tmpl @@ -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 @@ -68,10 +69,33 @@ $style $body +#def link_tag($tag) +$tag +#end def +#if $Tag +
+#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 +
#if $path.endswith("index.html") #set $path = $path[:-len("index.html")] #end if -
#if $path.startswith("/Russian/")

üÔÁ ÓÔÒÁÎÉÃÁ http://phd.pp.ru$path ÂÙÌÁ ÓÇÅÎÅÒÉÒÏ×ÁÎÁ $last_modified_ru ÉÚ ÛÁÂÌÏÎÁ CheetahTemplate $_fileBaseName; diff --git a/reindex_blog.py b/reindex_blog.py index f650542..4be9689 100755 --- a/reindex_blog.py +++ b/reindex_blog.py @@ -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,) -- 2.39.2