]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/recentchanges.pm
git: change calling convention of safe_git to have named arguments
[git.ikiwiki.info.git] / IkiWiki / Plugin / recentchanges.pm
index 3081ac1316efd501b95d1ba650d4ac321957b5cd..8ce9474be631dbd8ae428304e25d1d1d2adac3df 100644 (file)
@@ -16,6 +16,8 @@ sub import {
        hook(type => "sessioncgi", id => "recentchanges", call => \&sessioncgi);
        # Load goto to fix up links from recentchanges
        IkiWiki::loadplugin("goto");
        hook(type => "sessioncgi", id => "recentchanges", call => \&sessioncgi);
        # Load goto to fix up links from recentchanges
        IkiWiki::loadplugin("goto");
+       # ... and transient as somewhere to put our internal pages
+       IkiWiki::loadplugin("transient");
 }
 
 sub getsetup () {
 }
 
 sub getsetup () {
@@ -56,7 +58,7 @@ sub refresh ($) {
        # delete old and excess changes
        foreach my $page (keys %pagesources) {
                if ($pagesources{$page} =~ /\._change$/ && ! $seen{$page}) {
        # delete old and excess changes
        foreach my $page (keys %pagesources) {
                if ($pagesources{$page} =~ /\._change$/ && ! $seen{$page}) {
-                       unlink($config{srcdir}.'/'.$pagesources{$page});
+                       unlink($IkiWiki::Plugin::transient::transientdir.'/'.$pagesources{$page}) || unlink($config{srcdir}.'/'.$pagesources{$page});
                }
        }
 }
                }
        }
 }
@@ -178,7 +180,6 @@ sub store ($$$) {
                        else {
                                $_->{link} = pagetitle($_->{page});
                        }
                        else {
                                $_->{link} = pagetitle($_->{page});
                        }
-                       $_->{baseurl}=IkiWiki::baseurl(undef) if length $config{url};
 
                        $_;
                } @{$change->{pages}}
 
                        $_;
                } @{$change->{pages}}
@@ -226,7 +227,7 @@ sub store ($$$) {
                wikiname => $config{wikiname},
        );
        
                wikiname => $config{wikiname},
        );
        
-       $template->param(permalink => urlto($config{recentchangespage}, undef)."#change-".titlepage($change->{rev}))
+       $template->param(permalink => urlto($config{recentchangespage})."#change-".titlepage($change->{rev}))
                if exists $config{url};
        
        IkiWiki::run_hooks(pagetemplate => sub {
                if exists $config{url};
        
        IkiWiki::run_hooks(pagetemplate => sub {
@@ -235,8 +236,8 @@ sub store ($$$) {
        });
 
        my $file=$page."._change";
        });
 
        my $file=$page."._change";
-       writefile($file, $config{srcdir}, $template->output);
-       utime $change->{when}, $change->{when}, "$config{srcdir}/$file";
+       writefile($file, $IkiWiki::Plugin::transient::transientdir, $template->output);
+       utime $change->{when}, $change->{when}, $IkiWiki::Plugin::transient::transientdir.'/'.$file;
 
        return $page;
 }
 
        return $page;
 }