--- a/lib/helpers.py Sat Feb 07 05:05:29 2009 +0200
+++ b/lib/helpers.py Sat Feb 07 05:12:57 2009 +0200
@@ -13,3 +13,14 @@
return time.strftime(config.DATETIME_FMT)
+def breadcrumb (trail, links=True) :
+ """
+ Returns a nicely formatted breadcrumb tail, optinally with links
+ """
+
+ return ' » '.join(
+ (
+ '<a href="$site_url/%s">%s</a>' % (page.url, page.title) if links else page.title
+ ) for page in trail
+ )
+
--- a/static/style.css Sat Feb 07 05:05:29 2009 +0200
+++ b/static/style.css Sat Feb 07 05:12:57 2009 +0200
@@ -99,6 +99,10 @@
padding-right: 50px;
}
+div#breadcrumb {
+ font-size: x-small;
+}
+
/*
* Footer
*/
--- a/templates/layout.tmpl Sat Feb 07 05:05:29 2009 +0200
+++ b/templates/layout.tmpl Sat Feb 07 05:12:57 2009 +0200
@@ -13,13 +13,9 @@
</ul>
</%def>
-<%def name="breadcumb(trail)">
-${' » '.join(pi.title for pi in trail)}
-</%def>
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
- <title>qmsk.net :: ${breadcumb(menu.ancestry)}</title>
+ <title>qmsk.net ${' :: ' + h.breadcrumb(menu.ancestry, links=False) if menu.ancestry else ''}</title>
<link rel="Stylesheet" type="text/css" href="${site_root_url}/static/style.css" />
</head>
<body>
@@ -33,6 +29,9 @@
</div>
<div id="content">
+ <div id="breadcrumb">
+ <!-- ${h.breadcrumb(menu.ancestry)} -->
+ </div>
${page.content}
</div>