avoid stomping on inline's rootpage sub if it's not already present
If the inline plugin is not being loaded, or is perhaps loaded after po (when IkiWiki::Setup::getsetup loads all the plugins, for example), po should not inject its custom rootpage sub, as that will lead to a redefinition error message when inline loads.master
parent
9f7f128090
commit
f39d02583a
|
@ -66,8 +66,11 @@ sub import {
|
|||
inject(name => "IkiWiki::urlto", call => \&myurlto);
|
||||
$origsubs{'cgiurl'}=\&IkiWiki::cgiurl;
|
||||
inject(name => "IkiWiki::cgiurl", call => \&mycgiurl);
|
||||
$origsubs{'rootpage'}=\&IkiWiki::rootpage;
|
||||
inject(name => "IkiWiki::rootpage", call => \&myrootpage);
|
||||
if (IkiWiki->can('rootpage')) {
|
||||
$origsubs{'rootpage'}=\&IkiWiki::rootpage;
|
||||
inject(name => "IkiWiki::rootpage", call => \&myrootpage)
|
||||
if defined $origsubs{'rootpage'};
|
||||
}
|
||||
$origsubs{'isselflink'}=\&IkiWiki::isselflink;
|
||||
inject(name => "IkiWiki::isselflink", call => \&myisselflink);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue