]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/orphans.pm
po: remove renamed pages special handling, not needed anymore
[git.ikiwiki.info.git] / IkiWiki / Plugin / orphans.pm
index 0f96b9397445ea6f15b4b82cd2bded46143f6aaf..8e9ab0ff402a12799843981787f427dcfc13812c 100644 (file)
@@ -6,11 +6,20 @@ use warnings;
 use strict;
 use IkiWiki 2.00;
 
-sub import { #{{{
+sub import {
+       hook(type => "getsetup", id => "orphans", call => \&getsetup);
        hook(type => "preprocess", id => "orphans", call => \&preprocess);
-} # }}}
+}
 
-sub preprocess (@) { #{{{
+sub getsetup () {
+       return 
+               plugin => {
+                       safe => 1,
+                       rebuild => undef,
+               },
+}
+
+sub preprocess (@) {
        my %params=@_;
        $params{pages}="*" unless defined $params{pages};
        
@@ -34,7 +43,7 @@ sub preprocess (@) { #{{{
                next if grep { 
                        length $_ &&
                        ($_ !~ /\/\Q$discussion\E$/i || ! $config{discussion}) &&
-                       bestlink($page, $_) !~ /^($page|)$/ 
+                       bestlink($page, $_) !~ /^(\Q$page\E|)$/ 
                } @{$links{$page}};
                push @orphans, $page;
        }
@@ -49,6 +58,6 @@ sub preprocess (@) { #{{{
                                "</li>"
                        } sort @orphans).
                "</ul>\n";
-} # }}}
+}
 
 1