]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/orphans.pm
po plugin: force utf-8 encoding in POT files
[ikiwiki.git] / IkiWiki / Plugin / orphans.pm
index 0f96b9397445ea6f15b4b82cd2bded46143f6aaf..32cbc5dd5508d3df58945ebef75a80704034c7ad 100644 (file)
@@ -7,9 +7,18 @@ use strict;
 use IkiWiki 2.00;
 
 sub import { #{{{
+       hook(type => "getsetup", id => "orphans", call => \&getsetup);
        hook(type => "preprocess", id => "orphans", call => \&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;
        }