X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/6f1539320b7b2701d391c9921177b31898767bb7..98e4600fe1ef5c9dfe905d5d8e017b6b8dd9814a:/IkiWiki/Plugin/template.pm

diff --git a/IkiWiki/Plugin/template.pm b/IkiWiki/Plugin/template.pm
index 57bff20ff..b6097bb49 100644
--- a/IkiWiki/Plugin/template.pm
+++ b/IkiWiki/Plugin/template.pm
@@ -10,7 +10,8 @@ use Encode;
 
 sub import {
 	hook(type => "getsetup", id => "template", call => \&getsetup);
-	hook(type => "preprocess", id => "template", call => \&preprocess);
+	hook(type => "preprocess", id => "template", call => \&preprocess,
+		scan => 1);
 }
 
 sub getsetup () {
@@ -68,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