Some fixes to the parent links, I think the link to the index will be right
[ikiwiki.git] / ikiwiki
diff --git a/ikiwiki b/ikiwiki
index f95ea0f09c45a2f96c158ab87c4efb65519a00fe..7e140bbecc86b6bcbf85cff2dbeadcaa4aec1709 100755 (executable)
--- a/ikiwiki
+++ b/ikiwiki
@@ -307,15 +307,14 @@ sub parentlinks ($) { #{{{
        my $skip=1;
        foreach my $dir (reverse split("/", $page)) {
                if (! $skip) {
+                       $path.="../";
                        unshift @ret, { url => "$path$dir.html", page => $dir };
                }
                else {
                        $skip=0;
                }
-               $path.="../";
        }
-       $path=~s!../!!;
-       unshift @ret, { url => $path , page => $config{wikiname} };
+       unshift @ret, { url => length $path ? $path : ".", page => $config{wikiname} };
        return @ret;
 } #}}}