]> sipb.mit.edu Git - ikiwiki.git/commitdiff
avoid showing comment post stuff on dynamic pages
authorJoey Hess <joey@kitenet.net>
Sun, 16 May 2010 02:28:07 +0000 (22:28 -0400)
committerJoey Hess <joey@kitenet.net>
Sun, 16 May 2010 02:28:07 +0000 (22:28 -0400)
If the site is configured to allow comments on *, then the comment post
interface was being added to cgi pages like signin and prefs. This fixes it
w/o requiring more page.tmpl changes. The pagetemplate hook is called by
misctemplate with an empty page name for dynamic pages.

IkiWiki/Plugin/comments.pm

index 3cafcbe9c6860dbfb95087da454bf364617f1292..af7e7eccd89603430c7b0f4d5cee65b07c4ae02f 100644 (file)
@@ -742,6 +742,7 @@ sub pagetemplate (@) {
                     $template->query(name => 'commentsurl') ||
                     $template->query(name => 'atomcommentsurl') ||
                     $template->query(name => 'comments')) &&
+                   length $page && # not dynamic
                    commentsshown($page);
 
        if ($template->query(name => 'comments')) {