]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Render.pm
smiley escaping fixes
[ikiwiki.git] / IkiWiki / Render.pm
index c241fd40b5beb7abff5901246930d978cb9476b5..8a79119cd1173beb6a259ee4a3338e7dbbf6045b 100644 (file)
@@ -47,23 +47,6 @@ sub backlinks ($) { #{{{
        return @links;
 } #}}}
 
-sub parentlinks ($) { #{{{
-       my $page=shift;
-       
-       my @ret;
-       my $pagelink="";
-       my $path="";
-       my $title=$config{wikiname};
-       
-       foreach my $dir (split("/", $page)) {
-               next if $dir eq 'index';
-               push @ret, { url => urlto($path, $page), page => $title };
-               $path.="/".$dir;
-               $title=pagetitle($dir);
-       }
-       return @ret;
-} #}}}
-
 sub genpage ($$) { #{{{
        my $page=shift;
        my $content=shift;
@@ -121,7 +104,6 @@ sub genpage ($$) { #{{{
                        ? $config{wikiname} 
                        : pagetitle(basename($page)),
                wikiname => $config{wikiname},
-               parentlinks => [parentlinks($page)],
                content => $content,
                backlinks => $backlinks,
                more_backlinks => $more_backlinks,
@@ -229,10 +211,14 @@ sub render ($) { #{{{
                will_render($file, $file, 1);
                
                if ($config{hardlink}) {
-                       prep_writefile($file, $config{destdir});
-                       unlink($config{destdir}."/".$file);
-                       if (link($srcfile, $config{destdir}."/".$file)) {
-                               return;
+                       # only hardlink if owned by same user
+                       my @stat=stat($srcfile);
+                       if ($stat[4] == $>) {
+                               prep_writefile($file, $config{destdir});
+                               unlink($config{destdir}."/".$file);
+                               if (link($srcfile, $config{destdir}."/".$file)) {
+                                       return;
+                               }
                        }
                        # if hardlink fails, fall back to copying
                }