X-Git-Url: http://git.tremily.us/?p=ikiwiki.git;a=blobdiff_plain;f=IkiWiki%2FPlugin%2Frecentchanges.pm;h=e546e4702b43bda681e74996a51bcc6e6e3c0499;hp=56e80e7b815954e8a42c32bc284a03a62e94e327;hb=3dd98a3b3f66555ca3d83ec6940a9cd11cf8bec7;hpb=a981d6857f1eab350460116c1b5d868ed0215d29 diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm index 56e80e7b8..e546e4702 100644 --- a/IkiWiki/Plugin/recentchanges.pm +++ b/IkiWiki/Plugin/recentchanges.pm @@ -13,6 +13,8 @@ sub import { hook(type => "refresh", id => "recentchanges", call => \&refresh); hook(type => "pagetemplate", id => "recentchanges", call => \&pagetemplate); hook(type => "htmlize", id => "_change", call => \&htmlize); + # Load goto to fix up links from recentchanges + IkiWiki::loadplugin("goto"); } sub getsetup () { @@ -58,15 +60,15 @@ sub refresh ($) { } } -# Enable the recentchanges link on wiki pages. +# Enable the recentchanges link. sub pagetemplate (@) { my %params=@_; my $template=$params{template}; my $page=$params{page}; if (defined $config{recentchangespage} && $config{rcs} && - $page ne $config{recentchangespage} && - $template->query(name => "recentchangesurl")) { + $template->query(name => "recentchangesurl") && + $page ne $config{recentchangespage}) { $template->param(recentchangesurl => urlto($config{recentchangespage}, $page)); $template->param(have_actions => 1); } @@ -121,8 +123,8 @@ sub store ($$$) { } elsif (length $config{cgiurl}) { $change->{authorurl} = IkiWiki::cgiurl( - do => "recentchanges_link", - page => (length $config{userdir} ? "$config{userdir}/" : "").$change->{author}, + do => "goto", + page => IkiWiki::userpage($change->{author}), ); }