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,
