2 # Ikiwiki version plugin.
3 package IkiWiki::Plugin::version;
10 hook(type => "needsbuild", id => "version", call => \&needsbuild);
11 hook(type => "preprocess", id => "version", call => \&preprocess);
14 sub needsbuild (@) { #{{{
16 foreach my $page (keys %pagestate) {
17 if (exists $pagestate{$page}{version}{shown}) {
18 if ($pagestate{$page}{version}{shown} ne $IkiWiki::version) {
19 push @$needsbuild, $pagesources{$page};
21 if (exists $pagesources{$page} &&
22 grep { $_ eq $pagesources{$page} } @$needsbuild) {
23 # remove state, will be re-added if
24 # the version is still shown during the
26 delete $pagestate{$page}{version}{shown};
32 sub preprocess (@) { #{{{
34 $pagestate{$params{destpage}}{version}{shown}=$IkiWiki::version;