summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-10-08 21:56:50 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-10-08 21:56:50 +0000
commitcefbe6210f4e89984bb40062e4f9787b7372dd52 (patch)
tree5fd7195d25c124eef90e8d3e66b44ed1fbd8d644 /IkiWiki/Plugin
parent118c481766669959c34c30a79aa2667cdcc7aebc (diff)
* Change %renderedfiles to store an array of files rendered from a given
source file, to allow tracking of extra rendered files like rss feeds. * Note that plugins that accessed this variable will need to be updated! The plugin interface has been increased to version 1.01 for this change. * Add will_render function to the plugin interface, used to register that a page renders a destination file, and do some security checks. * Use will_render in the inline and linkmap plugins. * Previously but no longer rendered files will be cleaned up. * You will need to rebuild your wiki on upgrade to this version.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/inline.pm10
-rw-r--r--IkiWiki/Plugin/linkmap.pm6
-rw-r--r--IkiWiki/Plugin/search.pm3
3 files changed, 7 insertions, 12 deletions
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm
index 868f3816f..c7cafee12 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
@@ -4,7 +4,7 @@ package IkiWiki::Plugin::inline;
use warnings;
use strict;
-use IkiWiki;
+use IkiWiki 1.00;
use IkiWiki::Render; # for displaytime
use URI;
@@ -154,10 +154,8 @@ sub preprocess_inline (@) { #{{{
}
}
- # TODO: should really add this to renderedfiles and call
- # check_overwrite, but currently renderedfiles
- # only supports listing one file per page.
if ($config{rss} && $rss) {
+ will_render($params{page}, rsspage($params{page}));
writefile(rsspage($params{page}), $config{destdir},
genrss($desc, $params{page}, @list));
$toping{$params{page}}=1 unless $config{rebuild};
@@ -233,9 +231,7 @@ sub genrss ($$@) { #{{{
my $itemtemplate=template("rssitem.tmpl", blind_cache => 1);
my $content="";
foreach my $p (@pages) {
- next unless exists $renderedfiles{$p};
-
- my $u=URI->new(encode_utf8("$config{url}/$renderedfiles{$p}"));
+ my $u=URI->new(encode_utf8($config{url}."/".htmlpage($p)));
$itemtemplate->param(
title => pagetitle(basename($p)),
diff --git a/IkiWiki/Plugin/linkmap.pm b/IkiWiki/Plugin/linkmap.pm
index 497b1ef43..d7dffc941 100644
--- a/IkiWiki/Plugin/linkmap.pm
+++ b/IkiWiki/Plugin/linkmap.pm
@@ -57,12 +57,10 @@ sub genmap ($) { #{{{
# Use ikiwiki's function to create the file, this makes sure needed
# subdirs are there and does some sanity checking.
- writefile("$params{page}.png", $config{destdir}, "");
+ will_render($params{page}, $params{page}.".png");
+ writefile($params{page}.".png", $config{destdir}, "");
# Run dot to create the graphic and get the map data.
- # TODO: should really add the png to renderedfiles and call
- # check_overwrite, but currently renderedfiles
- # only supports listing one file per page.
my $pid;
my $sigpipe=0;;
$SIG{PIPE}=sub { $sigpipe=1 };
diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm
index 5a4dfd491..a57a84048 100644
--- a/IkiWiki/Plugin/search.pm
+++ b/IkiWiki/Plugin/search.pm
@@ -63,7 +63,8 @@ sub change (@) { #{{{
debug("updating hyperestraier search index");
estcmd("gather -cm -bc -cl -sd",
map {
- Encode::encode_utf8($config{destdir}."/".$renderedfiles{pagename($_)})
+ Encode::encode_utf8($config{destdir}."/".$_)
+ foreach @{$renderedfiles{pagename($_)}};
} @_
);
estcfg();