diff options
author | Joey Hess <joey@kitenet.net> | 2010-06-16 19:17:18 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-06-16 19:17:18 -0400 |
commit | 184f68efa88d6b8b4763ca18619b25e7d8ae1668 (patch) | |
tree | a9b27047c49246c694b1c465a05c15fe2dba81d5 /IkiWiki/Plugin/theme.pm | |
parent | eff5e233a2a3bf5e965c17734a3ad765c5fe9df5 (diff) | |
parent | bc32754f1f1ca334078f788a346c27839e245cab (diff) |
Merge branch 'themes'
Diffstat (limited to 'IkiWiki/Plugin/theme.pm')
-rw-r--r-- | IkiWiki/Plugin/theme.pm | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/theme.pm b/IkiWiki/Plugin/theme.pm new file mode 100644 index 000000000..ba6966381 --- /dev/null +++ b/IkiWiki/Plugin/theme.pm @@ -0,0 +1,37 @@ +#!/usr/bin/perl +package IkiWiki::Plugin::theme; + +use warnings; +use strict; +use IkiWiki 3.00; + +sub import { + hook(type => "getsetup", id => "theme", call => \&getsetup); + hook(type => "checkconfig", id => "theme", call => \&checkconfig); +} + +sub getsetup () { + return + plugin => { + safe => 1, + rebuild => 0, + section => "web", + }, + theme => { + type => "string", + example => "actiontabs", + description => "name of theme to enable", + safe => 1, + rebuild => 1, + }, +} + +my $added=0; +sub checkconfig () { + if (! $added && exists $config{theme} && $config{theme} =~ /^\w+$/) { + add_underlay("themes/".$config{theme}); + $added=1; + } +} + +1 |