summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-03-24 15:10:58 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-03-24 15:10:58 +0000
commitbbb0b3e72f6a3ffaac8343fc847800d7faaa7573 (patch)
treee14c3599c78123ed6740b0352b2fe45401ceb5b4 /IkiWiki/Plugin
parentdc0bf7982fa35362ac7e750640323891c7268ed2 (diff)
* Finally fixed the longstanding inline removal bug.
* Renamed %oldpagemtime to a more accurately named %pagemtime and fix it to actually store pages' mtimes. * Add "mtime" sort parameter to inline plugin.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/inline.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm
index 3a2e0a05f..dcaaa21eb 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
@@ -96,6 +96,9 @@ sub preprocess_inline (@) { #{{{
if (exists $params{sort} && $params{sort} eq 'title') {
@list=sort @list;
}
+ elsif (exists $params{sort} && $params{sort} eq 'mtime') {
+ @list=sort { $pagemtime{$b} <=> $pagemtime{$a} } @list;
+ }
elsif (! exists $params{sort} || $params{sort} eq 'age') {
@list=sort { $pagectime{$b} <=> $pagectime{$a} } @list;
}
@@ -116,6 +119,10 @@ sub preprocess_inline (@) { #{{{
}
add_depends($params{page}, $params{pages});
+ # Explicitly add all currently displayed pages as dependencies, so
+ # that if they are removed or otherwise changed, the inline will be
+ # sure to be updated.
+ add_depends($params{page}, join(" or ", @list));
my $rssurl=rsspage(basename($params{page}));
my $atomurl=atompage(basename($params{page}));