summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-01-26 20:13:15 -0500
committerJoey Hess <joey@gnu.kitenet.net>2009-01-26 20:13:15 -0500
commit5c14c7db615bc06324c3801088d05c06c8824b16 (patch)
tree8767d5c9f2246fd809285a49f8a27e73dfe3ce7a /IkiWiki/Plugin
parent9b4040992d69829b914d141551422722b84fca0e (diff)
parent2fd1857a527303f529274a229596dd6eb64b0a48 (diff)
Merge commit 'smcv/underlay'
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/underlay.pm40
1 files changed, 40 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/underlay.pm b/IkiWiki/Plugin/underlay.pm
new file mode 100644
index 000000000..380d418fb
--- /dev/null
+++ b/IkiWiki/Plugin/underlay.pm
@@ -0,0 +1,40 @@
+#!/usr/bin/perl
+package IkiWiki::Plugin::underlay;
+# Copyright © 2008 Simon McVittie <http://smcv.pseudorandom.co.uk/>
+# Licensed under the GNU GPL, version 2, or any later version published by the
+# Free Software Foundation
+
+use warnings;
+use strict;
+use IkiWiki 3.00;
+
+sub import {
+ hook(type => "getsetup", id => "underlay", call => \&getsetup);
+ hook(type => "checkconfig", id => "underlay", call => \&checkconfig);
+}
+
+sub getsetup () {
+ return
+ plugin => {
+ safe => 0,
+ rebuild => undef,
+ },
+ add_underlays => {
+ type => "string",
+ default => [],
+ description => "extra underlay directories to add",
+ advanced => 1,
+ safe => 0,
+ rebuild => 1,
+ },
+}
+
+sub checkconfig () {
+ return unless exists $config{add_underlays};
+
+ foreach my $dir (@{$config{add_underlays}}) {
+ add_underlay($dir);
+ }
+}
+
+1;