]> git.phdru.name Git - phdru.name/phdru.name.git/blobdiff - phd_site.tmpl
Feat(blog): Encode tags
[phdru.name/phdru.name.git] / phd_site.tmpl
index 65bb058a079d02463b720786570452ecbeac1367..67eb3412546901353bbb619c3e55bad2b3373f4b 100644 (file)
@@ -139,8 +139,12 @@ $style
 #end if
 </p>
 $body
+#from urllib import quote
+#def encode_tag(tag):
+$quote(tag.decode('utf-8').encode('koi8-r').replace(' ', '_'))
+#end def
 #def link_tag($tag)
-<a href="../../../tags/${tag}.html">$tag</a>
+<a href="../../../tags/${encode_tag(tag)}.html">$tag</a>
 #end def
 #if $Tag
 <hr width="90%">