]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - IkiWiki/Plugin/theme.pm
Merge branch 'master' of ssh://git.ikiwiki.info/srv/git/ikiwiki.info
[git.ikiwiki.info.git] / IkiWiki / Plugin / theme.pm
1 #!/usr/bin/perl
2 package IkiWiki::Plugin::theme;
4 use warnings;
5 use strict;
6 use IkiWiki 3.00;
8 sub import {
9         hook(type => "getsetup", id => "theme", call => \&getsetup);
10         hook(type => "checkconfig", id => "theme", call => \&checkconfig);
11 }
13 sub getsetup () {
14         return
15                 plugin => {
16                         safe => 1,
17                         rebuild => 0,
18                         section => "web",
19                 },
20                 theme => {
21                         type => "string",
22                         example => "actiontabs",
23                         description => "name of theme to enable",
24                         safe => 1,
25                         rebuild => 1,
26                 },
27 }
29 my $added=0;
30 sub checkconfig () {
31         if (! $added && exists $config{theme} && $config{theme} =~ /^\w+$/) {
32                 add_underlay("themes/".$config{theme});
33                 $added=1;
34         }
35 }
37 1