X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/9f401d6617a11efcedda1c956b2ccea061a7540f..bb5cf4a0940b8fd2750c6175adb15382b84c71e2:/IkiWiki/Plugin/theme.pm

diff --git a/IkiWiki/Plugin/theme.pm b/IkiWiki/Plugin/theme.pm
index 03b0816ed..9b84ea7f0 100644
--- a/IkiWiki/Plugin/theme.pm
+++ b/IkiWiki/Plugin/theme.pm
@@ -9,6 +9,7 @@ sub import {
 	hook(type => "getsetup", id => "theme", call => \&getsetup);
 	hook(type => "checkconfig", id => "theme", call => \&checkconfig);
 	hook(type => "needsbuild", id => "theme", call => \&needsbuild);
+	hook(type => "pagetemplate", id => "theme", call => \&pagetemplate);
 }
 
 sub getsetup () {
@@ -60,6 +61,15 @@ sub needsbuild ($) {
 		
 		$wikistate{theme}{currenttheme}=$config{theme};
 	}
+	return $needsbuild;
+}
+
+sub pagetemplate (@) {
+	my %params=@_;
+	my $template=$params{template};
+	if (exists $config{theme} && length $config{theme})  {
+		$template->param("theme_$config{theme}" => 1);
+	}
 }
 
 1