]> git.phdru.name Git - phdru.name/phdru.name.git/commitdiff
Generate breadcrumbs
authorOleg Broytman <phd@phdru.name>
Sun, 8 Jun 2014 16:26:25 +0000 (20:26 +0400)
committerOleg Broytman <phd@phdru.name>
Wed, 23 Dec 2015 15:54:09 +0000 (18:54 +0300)
phd_site.tmpl

index 6da679aa1a9311ec8bd7662f8e9722f36b3a92c3..003c5b90d8255beea7b5717ece9c106197fc6599 100644 (file)
@@ -105,6 +105,15 @@ $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)
+</p>
 $body
 #def link_tag($tag)
 <a href="../../../tags/${tag}.html">$tag</a>