enable action bar on misctemplates
[ikiwiki.git] / IkiWiki.pm
index 11cfcdfd2d9ef31112f431963d52e8c31efe0f01..46c29abe38a045b813a8a32a632c3f97c729faa8 100644 (file)
@@ -1004,7 +1004,7 @@ sub displaytime ($;$$) {
        my $time=formattime($_[0], $_[1]);
        if ($config{html5}) {
                return '<time datetime="'.date_3339($_[0]).'"'.
-                       ($_[2] ? ' pubdate' : '').
+                       ($_[2] ? ' pubdate="pubdate"' : '').
                        '>'.$time.'</time>';
        }
        else {
@@ -1748,7 +1748,6 @@ sub misctemplate ($$;@) {
 
        $template->param(
                dynamic => 1,
-               have_actions => 0, # force off
                title => $title,
                wikiname => $config{wikiname},
                content => $content,
@@ -1756,6 +1755,16 @@ sub misctemplate ($$;@) {
                html5 => $config{html5},
                @_,
        );
+       
+       my @actions;
+       run_hooks(pageactions => sub {
+               push @actions, map { { action => $_ } } 
+                       grep { defined } shift->(page => "");
+       });
+       $template->param(actions => \@actions);
+       if (@actions) {
+               $template->param(have_actions => 1);
+       }
 
        return $template->output;
 }
@@ -2348,7 +2357,8 @@ sub match_internal ($$;@) {
 sub match_page ($$;@) {
        my $page=shift;
        my $match=match_glob($page, shift, @_);
-       if ($match && ! defined IkiWiki::pagetype($IkiWiki::pagesources{$page})) {
+       if ($match && ! (exists $IkiWiki::pagesources{$page}
+           && defined IkiWiki::pagetype($IkiWiki::pagesources{$page}))) {
                return IkiWiki::FailReason->new("$page is not a page");
        }
        else {