]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/mirrorlist.pm
add description_html
[ikiwiki.git] / IkiWiki / Plugin / mirrorlist.pm
index 216d870fda45e0e5e257ad08c403c1ce2adb0619..f7c78fdee33769584278b131955b8eac28291716 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",
+                       example => {},
+                       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}->{$_}."/".$page.
+                               $config{mirrorlist}->{$_}."/".urlto($page, "").
                                qq{">$_</a>}
                        } keys %{$config{mirrorlist}}
                ).