2 # Ikiwiki version plugin.
3 package IkiWiki::Plugin::version;
10 hook(type => "getsetup", id => "version", call => \&getsetup);
11 hook(type => "needsbuild", id => "version", call => \&needsbuild);
12 hook(type => "preprocess", id => "version", call => \&preprocess);
15 sub getsetup () { #{{{
23 sub needsbuild (@) { #{{{
25 foreach my $page (keys %pagestate) {
26 if (exists $pagestate{$page}{version}{shown}) {
27 if ($pagestate{$page}{version}{shown} ne $IkiWiki::version) {
28 push @$needsbuild, $pagesources{$page};
30 if (exists $pagesources{$page} &&
31 grep { $_ eq $pagesources{$page} } @$needsbuild) {
32 # remove state, will be re-added if
33 # the version is still shown during the
35 delete $pagestate{$page}{version}{shown};
41 sub preprocess (@) { #{{{
43 $pagestate{$params{destpage}}{version}{shown}=$IkiWiki::version;