When loading a template in scan mode, let preprocess know it only needs to scan.
authorJoey Hess <joey@gnu.kitenet.net>
Sun, 8 Mar 2009 22:57:47 +0000 (18:57 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Sun, 8 Mar 2009 22:57:47 +0000 (18:57 -0400)
This makes wikis such as zack's much faster in the scan pass.
In that pass, when a template contains an inline, there is no reason to
process the entire inline and all its pages. I'd forgotten to pass
along the flag to let preprocess() know it was in scan mode, leading to
much unncessary churning.

IkiWiki/Plugin/template.pm
debian/changelog

index b872f0962a2b410f7c2cc35cc8c9d82df94a98a1..b6097bb49d26133a54dc2fa27c3fc98e59d657bb 100644 (file)
@@ -69,9 +69,13 @@ sub preprocess (@) {
                }
        }
 
+       # This needs to run even in scan mode, in order to process
+       # links and other metadata includes via the template.
+       my $scan=! defined wantarray;
+
        return IkiWiki::preprocess($params{page}, $params{destpage},
                IkiWiki::filter($params{page}, $params{destpage},
-               $template->output));
+               $template->output), $scan);
 }
 
 1
index e5d52220079dc39c3256343ca88d5633406cb56d..95d414bc794a456598a977a0d74717f2101f4adb 100644 (file)
@@ -5,6 +5,8 @@ ikiwiki (3.07) UNRELEASED; urgency=low
   * wmd: New plugin contributed by William Uther to support the WMD
     Wysiwym markdown editor.
   * smiley: Avoid infinite loop in smiley expansion. Closes: #518805
+  * template: When loading a template in scan mode, let preprocess
+    know it only needs to scan.
 
  -- Joey Hess <joeyh@debian.org>  Thu, 05 Mar 2009 15:43:02 -0500