From dd2fa2efb956f8af6c98d37f8cfd280df2f97cb5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 8 Mar 2009 18:57:47 -0400 Subject: [PATCH 1/1] When loading a template in scan mode, let preprocess know it only needs to scan. 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 | 6 +++++- debian/changelog | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/IkiWiki/Plugin/template.pm b/IkiWiki/Plugin/template.pm index b872f0962..b6097bb49 100644 --- a/IkiWiki/Plugin/template.pm +++ b/IkiWiki/Plugin/template.pm @@ -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 diff --git a/debian/changelog b/debian/changelog index e5d522200..95d414bc7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Thu, 05 Mar 2009 15:43:02 -0500 -- 2.44.0