]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/mirrorlist.pm
added getsetup hooks for all plugins up to recentchanges
[ikiwiki.git] / IkiWiki / Plugin / mirrorlist.pm
index ecccd243f24164e59c215ec9f14f97699c251655..c7630d81f0b60911fed26b32baba015e3ea9757c 100644 (file)
@@ -3,12 +3,24 @@ package IkiWiki::Plugin::mirrorlist;
 
 use warnings;
 use strict;
-use IkiWiki;
+use IkiWiki 2.00;
 
 sub import { #{{{
+       hook(type => "getsetup", id => "mirrorlist", call => \&getsetup);
        hook(type => "pagetemplate", id => "mirrorlist", call => \&pagetemplate);
 } # }}}
 
+sub getsetup () { #{{{
+       return
+               mirrorlist => {
+                       type => "string",
+                       default => "",
+                       description => "list of mirrors",
+                       safe => 1,
+                       rebuild => 1,
+               },
+} #}}}
+
 sub pagetemplate (@) { #{{{
        my %params=@_;
         my $template=$params{template};
@@ -25,7 +37,7 @@ sub mirrorlist ($) { #{{{
                join(", ",
                        map { 
                                qq{<a href="}.
-                               $config{mirrorlist}->{$_}."/".htmlpage($page).
+                               $config{mirrorlist}->{$_}."/".urlto($page, "").
                                qq{">$_</a>}
                        } keys %{$config{mirrorlist}}
                ).