Index: /trunk/bookmark.tt
===================================================================
--- /trunk/bookmark.tt	(revision 2)
+++ /trunk/bookmark.tt	(revision 3)
@@ -22,9 +22,9 @@
       <a href="[% uri %]" target="_blank">[% title or uri %]</a>
       [% IF exists %]
-        <p>[% created %]</p>
+        <p class="timestamps">[% created %]</p>
         [% IF tags.size %]
-          <p>Tagged as:
+          <p class="tags">Tagged as:
             [% FOREACH tag IN tags %]
-              <a href="?tag=[% tag %]">[% tag %]</a>
+              <a href=".?tag=[% tag %]" class="tag" target="_blank" onclick="if (opener && !opener.closed) { opener.location = this.href; return false; }">[% tag %]</a>
             [% END %]
           </p>
@@ -64,5 +64,7 @@
 window.onload = function() {
     if (document.location.hash == '#updated') {
-        opener.location.reload();
+        if (opener) {
+            opener.location.reload();
+        }
     }
 };
Index: /trunk/index.cgi
===================================================================
--- /trunk/index.cgi	(revision 2)
+++ /trunk/index.cgi	(revision 3)
@@ -98,9 +98,6 @@
             }
         } else {
-            #print $q->header('text/html');
-            #print "TODO: list bookmarks";
-            #return;
-            # list all the resources
-            my $format = $q->param('format');
+            # list all the bookmarks 
+            my $format = $q->param('format') || 'html';
             my $tag = $q->param('tag');
             my @resources = $bookmarks->get_resources({ tag => $tag });
@@ -123,7 +120,13 @@
                     -charset => 'UTF-8',
                 );
+
+                # set the base URL, adding a trailing slash if needed
+                my $base_url = $q->url;
+                $base_url .= '/' if $base_url =~ m{/bookmarks$};
+
                 $template->process(
                     'list.tt',
                     {
+                        base_url     => $base_url,
                         selected_tag => $tag,
                         tags         => \@all_tags,
Index: /trunk/list.tt
===================================================================
--- /trunk/list.tt	(revision 2)
+++ /trunk/list.tt	(revision 3)
@@ -2,4 +2,5 @@
   <head>
     <title>Bookmarks</title>
+    <base href="[% base_url %]"/>
     <style type="text/css">
 a:hover {
@@ -64,5 +65,5 @@
         <li>
           <span class="edit">
-	    (<a href="bookmarks/[% resource.id %]" onclick="window.open(this.href, 'edit_bookmark', 'width=800,height=250').focus(); return false;">Edit</a>)
+	    (<a href="[% resource.id %]" onclick="window.open(this.href, 'edit_bookmark', 'width=800,height=250').focus(); return false;">Edit</a>)
 	  </span>
           <a href="[% resource.uri %]" title="[% resource.title | html %] ([% resource.tags.join(', ') %])">[% resource.title or resource.uri %]</a>
