]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/mirrorlist.pm
add plugin safe/rebuild info (part 1 of 2)
[ikiwiki.git] / IkiWiki / Plugin / mirrorlist.pm
index ecccd243f24164e59c215ec9f14f97699c251655..7e53fe068546488518a79c13365d3c1ee21c45da 100644 (file)
@@ -3,12 +3,28 @@ package IkiWiki::Plugin::mirrorlist;
 
 use warnings;
 use strict;
 
 use warnings;
 use strict;
-use IkiWiki;
+use IkiWiki 2.00;
 
 sub import { #{{{
 
 sub import { #{{{
+       hook(type => "getsetup", id => "mirrorlist", call => \&getsetup);
        hook(type => "pagetemplate", id => "mirrorlist", call => \&pagetemplate);
 } # }}}
 
        hook(type => "pagetemplate", id => "mirrorlist", call => \&pagetemplate);
 } # }}}
 
+sub getsetup () { #{{{
+       return
+               plugin => {
+                       safe => 1,
+                       rebuild => 1,
+               },
+               mirrorlist => {
+                       type => "string",
+                       example => {},
+                       description => "list of mirrors",
+                       safe => 1,
+                       rebuild => 1,
+               },
+} #}}}
+
 sub pagetemplate (@) { #{{{
        my %params=@_;
         my $template=$params{template};
 sub pagetemplate (@) { #{{{
        my %params=@_;
         my $template=$params{template};
@@ -25,7 +41,7 @@ sub mirrorlist ($) { #{{{
                join(", ",
                        map { 
                                qq{<a href="}.
                join(", ",
                        map { 
                                qq{<a href="}.
-                               $config{mirrorlist}->{$_}."/".htmlpage($page).
+                               $config{mirrorlist}->{$_}."/".urlto($page, "").
                                qq{">$_</a>}
                        } keys %{$config{mirrorlist}}
                ).
                                qq{">$_</a>}
                        } keys %{$config{mirrorlist}}
                ).