X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/ca9c6cc254d934837406ef9bb0dc5d021983661b..58a07f9e5436ec815c0cb5736a9680096c977eed:/IkiWiki/Render.pm?ds=inline diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 50af2bdec..fc5d3953d 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -112,7 +112,14 @@ sub genpage ($$) { } } - if ($actions) { + my @actions; + run_hooks(pageactions => sub { + push @actions, map { { action => $_ } } + grep { defined } shift->(page => $page); + }); + $template->param(actions => \@actions); + + if ($actions || @actions) { $template->param(have_actions => 1); } @@ -131,13 +138,16 @@ sub genpage ($$) { title => $page eq 'index' ? $config{wikiname} : pagetitle(basename($page)), + ispage => 1, wikiname => $config{wikiname}, content => $content, backlinks => $backlinks, more_backlinks => $more_backlinks, mtime => displaytime($pagemtime{$page}), - ctime => displaytime($pagectime{$page}), + ctime => displaytime($pagectime{$page}, undef, 1), baseurl => baseurl($page), + have_footer => 1, + html5 => $config{html5}, ); run_hooks(pagetemplate => sub { @@ -313,6 +323,7 @@ sub find_src_files () { my ($f) = $file =~ /$config{wiki_file_regexp}/; # untaint if (! defined $f) { warn(sprintf(gettext("skipping bad filename %s"), $file)."\n"); + return; } if ($underlay) { @@ -409,7 +420,7 @@ sub find_del_files ($) { my @del; my @internal_del; - foreach my $page (keys %pagemtime) { + foreach my $page (keys %pagesources) { if (! $pages->{$page}) { if (isinternal($page)) { push @internal_del, $pagesources{$page}; @@ -592,15 +603,20 @@ sub render_dependent ($$$$$$$) { my %lc_changed = map { lc(pagename($_)) => 1 } @changed; my %lc_exists_changed = map { lc(pagename($_)) => 1 } @exists_changed; - my $mass_reason; - foreach my $p ("page.tmpl", keys %{$depends_simple{""}}) { - $mass_reason=$p if $rendered{$p}; + foreach my $p ("templates/page.tmpl", keys %{$depends_simple{""}}) { + if ($rendered{$p} || grep { $_ eq $p } @$del) { + foreach my $f (@$files) { + next if $rendered{$f}; + render($f, sprintf(gettext("building %s, which depends on %s"), $f, $p)); + } + return 0; + } } foreach my $f (@$files) { next if $rendered{$f}; my $p=pagename($f); - my $reason = $mass_reason; + my $reason = undef; if (exists $depends_simple{$p} && ! defined $reason) { foreach my $d (keys %{$depends_simple{$p}}) {