]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
theme: Now <TMPL_IF THEME_$NAME> can be used in all templates when a theme is enabled.
authorJoey Hess <joey@kitenet.net>
Fri, 17 May 2013 02:20:56 +0000 (22:20 -0400)
committerJoey Hess <joey@kitenet.net>
Fri, 17 May 2013 02:20:56 +0000 (22:20 -0400)
IkiWiki/Plugin/theme.pm
debian/changelog

index ee94547e90c51dad608b020e1be6bc0a434d38d7..9b84ea7f023d10c6db947f136adb4ed8b8ec72e0 100644 (file)
@@ -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 () {
@@ -63,4 +64,12 @@ sub needsbuild ($) {
        return $needsbuild;
 }
 
+sub pagetemplate (@) {
+       my %params=@_;
+       my $template=$params{template};
+       if (exists $config{theme} && length $config{theme})  {
+               $template->param("theme_$config{theme}" => 1);
+       }
+}
+
 1
index e6d39fa27b17169b53abd6e19a58b1be69c2c00b..fb51569b321cf224c87c758fa2fd2edfeb983586 100644 (file)
@@ -2,6 +2,8 @@ ikiwiki (3.20130505) UNRELEASED; urgency=low
 
   * Fix test suite to not fail when XML::Twig is not installed.
     Closes: #707436
+  * theme: Now <TMPL_IF THEME_$NAME> can be used in all templates when
+    a theme is enabled.
 
  -- Joey Hess <joeyh@debian.org>  Thu, 09 May 2013 10:47:18 -0400