]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Render.pm
use __TINYC__ define to avoid tinyc compat fixes breaking FreeBSD
[ikiwiki.git] / IkiWiki / Render.pm
index 308d60ed0f4931aad93bd23897ba86e8b92e49d0..af24df1550ee7682d649a79e046d0e604c39e0cf 100644 (file)
@@ -78,11 +78,14 @@ sub genpage ($$) {
        my $actions=0;
 
        if (length $config{cgiurl}) {
-               $template->param(editurl => cgiurl(do => "edit", page => $page))
-                       if IkiWiki->can("cgi_editpage");
-               $template->param(prefsurl => cgiurl(do => "prefs"))
-                       if exists $hooks{auth};
-               $actions++;
+               if (IkiWiki->can("cgi_editpage")) {
+                       $template->param(editurl => cgiurl(do => "edit", page => $page));
+                       $actions++;
+               }
+               if (exists $hooks{auth}) {
+                       $template->param(prefsurl => cgiurl(do => "prefs"));
+                       $actions++;
+               }
        }
                
        if (defined $config{historyurl} && length $config{historyurl}) {
@@ -92,7 +95,7 @@ sub genpage ($$) {
                $actions++;
        }
        if ($config{discussion}) {
-               if ($page !~ /.*\/\Q$config{discussionpage}\E$/ &&
+               if ($page !~ /.*\/\Q$config{discussionpage}\E$/i &&
                   (length $config{cgiurl} ||
                    exists $links{$page."/".$config{discussionpage}})) {
                        $template->param(discussionlink => htmllink($page, $page, $config{discussionpage}, noimageinline => 1, forcesubpage => 1));
@@ -680,6 +683,17 @@ sub refresh () {
        }
 }
 
+sub clean_rendered {
+       lockwiki();
+       loadindex();
+       remove_unrendered();
+       foreach my $page (keys %oldrenderedfiles) {
+               foreach my $file (@{$oldrenderedfiles{$page}}) {
+                       prune($config{destdir}."/".$file);
+               }
+       }
+}
+
 sub commandline_render () {
        lockwiki();
        loadindex();