<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/perl
package IkiWiki::Plugin::underlay;
# Copyright Â© 2008 Simon McVittie &lt;http://smcv.pseudorandom.co.uk/&gt;
# 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 =&gt; "getsetup", id =&gt; "underlay",  call =&gt; \&amp;getsetup);
	hook(type =&gt; "checkconfig", id =&gt; "underlay", call =&gt; \&amp;checkconfig);
}

sub getsetup () {
	return
		plugin =&gt; {
			safe =&gt; 0,
			rebuild =&gt; undef,
			section =&gt; "special-purpose",
		},
		add_underlays =&gt; {
			type =&gt; "string",
			example =&gt; ["$ENV{HOME}/wiki.underlay"],
			description =&gt; "extra underlay directories to add",
			advanced =&gt; 1,
			safe =&gt; 0,
			rebuild =&gt; 1,
		},
}

sub checkconfig () {
	if ($config{add_underlays}) {
		foreach my $dir (@{$config{add_underlays}}) {
			add_underlay($dir);
		}
	}
}

1;
</pre></body></html>