]> git.phdru.name Git - phdru.name/phdru.name.git/blobdiff - phd_site.tmpl
Проставить в блоге ссылки на пред./след. посты по времени
[phdru.name/phdru.name.git] / phd_site.tmpl
index 6da679aa1a9311ec8bd7662f8e9722f36b3a92c3..9f3bc64bbbf963cdf8d9de32a8f4fbacab9bfb09 100644 (file)
@@ -95,7 +95,7 @@ $style
 #end for
 #end if
 <link rel="shortcut icon" href="${root}favicon.ico">
-#if not $root
+#if not $root and $path.endswith('index.html')
 <link rel="openid.delegate" href="http://phdru.name/">
 <link rel="openid2.local_id" href="http://phdru.name/">
 <link rel="openid.server" href="http://home.phdru.name/cgi-bin/poit.py">
@@ -105,13 +105,49 @@ $style
 </head>
 <body bgcolor="#CCCCCC" text="#000000"
       link="#0000bb"  vlink="#551a8b" alink="#ff0000">
+<p class="small">
+#set $path_components = $path.split('/')[1:-1]
+#set $breadcrumbs = ['<a href="' + $root + '">phdru.name</a>']
+#for $i in range(len($path_components))
+#set $subpath = '/'.join($path_components[:i+1])
+#silent $breadcrumbs.append('<a href="' + $root + $subpath + '/">' + $path_components[i]+ '</a>')
+#end for
+#echo " / ".join($breadcrumbs)
+#if $path.startswith("/Russian/blog/")
+#set $prev_key, $prev_blog_post, $next_key, $next_blog_post = $find_near_blog_posts()
+#if $prev_blog_post
+#set $prev_href = $root + "Russian/blog/" + '/'.join($prev_key + ($prev_blog_post[0].replace('.tmpl', '.html'),))
+#set $prev_title = $prev_blog_post[1].decode('koi8-r')
+#end if
+#if $next_blog_post
+#set $next_href = $root + "Russian/blog/" + '/'.join($next_key + ($next_blog_post[0].replace('.tmpl', '.html'),))
+#set $next_title = $next_blog_post[1].decode('koi8-r')
+#end if
+<br>
+<table width="100%">
+  <tr>
+#if $prev_blog_post
+    <td style="text-align: left" width="50%">&lt;-- <a href="$prev_href">$prev_title</a></td>
+#else
+    <td style="text-align: left" width="50%">&nbsp;</td>
+#end if
+#if $next_blog_post
+    <td style="text-align: right" width="50%"><a href="$next_href">$next_title</a> --&gt;</td>
+#else
+    <td style="text-align: right" width="50%">&nbsp;</td>
+#end if
+  </tr>
+</table>
+#end if
+</p>
 $body
 #def link_tag($tag)
 <a href="../../../tags/${tag}.html">$tag</a>
 #end def
 #if $Tag
 <hr width="90%">
-#if isinstance($Tag, basestring)
+#from Cheetah.compat import string_type
+#if isinstance($Tag, string_type)
 #if $path.startswith("/Russian/")
 Тег:
 #else