aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IkiWiki.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 633c51381..edee8aacb 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -681,11 +681,12 @@ sub srcfile ($;$) { #{{{
sub add_underlay ($) { #{{{
my $dir=shift;
- if ($dir=~/^\//) {
- unshift @{$config{underlaydirs}}, $dir;
+ if ($dir !~ /^\//) {
+ $dir="$config{underlaydir}/../$dir";
}
- else {
- unshift @{$config{underlaydirs}}, "$config{underlaydir}/../$dir";
+
+ if (! grep { $_ eq $dir } @{$config{underlaydirs}}) {
+ unshift @{$config{underlaydirs}}, $dir;
}
return 1;