forgot to add

master
Joey Hess 2007-12-08 19:05:01 -05:00
parent fd6d85aa79
commit b4b452f4ee
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,29 @@
#!/usr/bin/perl
# Ikiwiki version plugin.
package IkiWiki::Plugin::version;
use warnings;
use strict;
use IkiWiki 2.00;
sub import { #{{{
hook(type => "needsbuild", id => "version", call => \&needsbuild);
hook(type => "preprocess", id => "version", call => \&preprocess);
} # }}}
sub needsbuild (@) { #{{{
my $needsbuild=shift;
foreach my $page (keys %pagestate) {
if (exists $pagestate{$page}{version}{shown} &&
$pagestate{$page}{version}{shown} ne $IkiWiki::version) {
push @$needsbuild, $pagesources{$page};
}
}
} # }}}
sub preprocess (@) { #{{{
my %params=@_;
$pagestate{$params{destpage}}{version}{shown}=$IkiWiki::version;
} # }}}
1

View File

@ -0,0 +1,11 @@
[[template id=plugin name=version author="[[Joey]]"]]
[[tag type/useful]]
This plugin allows inserting the version of ikiwiki onto a page.
Whenever ikiwiki is upgraded to a new version, the page will be rebuilt,
updating the version number.
Use is simple:
\[[version ]]