]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/link.pm
Group related plugins into sections in the setup file, and drop unused rcs plugins...
[ikiwiki.git] / IkiWiki / Plugin / link.pm
index 48691d97363881d2a70e210364e8fd76abb2eede..3838aec09708450d8d3f9ba338b3cb3b09ee6892 100644 (file)
@@ -12,7 +12,7 @@ sub import {
        hook(type => "checkconfig", id => "link", call => \&checkconfig);
        hook(type => "linkify", id => "link", call => \&linkify);
        hook(type => "scan", id => "link", call => \&scan);
        hook(type => "checkconfig", id => "link", call => \&checkconfig);
        hook(type => "linkify", id => "link", call => \&linkify);
        hook(type => "scan", id => "link", call => \&scan);
-       hook(type => "renamelink", id => "link", call => \&renamelink);
+       hook(type => "renamepage", id => "link", call => \&renamepage);
 }
 
 sub getsetup () {
 }
 
 sub getsetup () {
@@ -20,6 +20,7 @@ sub getsetup () {
                plugin => {
                        safe => 1,
                        rebuild => 1,
                plugin => {
                        safe => 1,
                        rebuild => 1,
+                       section => "core",
                },
 }
 
                },
 }
 
@@ -86,11 +87,11 @@ sub scan (@) {
        my $content=$params{content};
 
        while ($content =~ /(?<!\\)$link_regexp/g) {
        my $content=$params{content};
 
        while ($content =~ /(?<!\\)$link_regexp/g) {
-               push @{$links{$page}}, linkpage($2);
+               add_link($page, linkpage($2));
        }
 }
 
        }
 }
 
-sub renamelink (@) {
+sub renamepage (@) {
        my %params=@_;
        my $page=$params{page};
        my $old=$params{oldpage};
        my %params=@_;
        my $page=$params{page};
        my $old=$params{oldpage};