summaryrefslogtreecommitdiff
path: root/IkiWiki.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2010-03-14 14:58:13 -0400
committerJoey Hess <joey@gnu.kitenet.net>2010-03-14 14:58:13 -0400
commit823ec815d4fc9625d6fa3553ad03e9f2ff737659 (patch)
tree50900e409091975988df76257d6d1fe30f739d4a /IkiWiki.pm
parenta79c52337c1d42f18492caf0ba3da970874210c1 (diff)
Add a include setting, which can be used to make ikiwiki process wiki source files, such as .htaccess, that would normally be skipped for security or other reasons. Closes: #447267 (Thanks to Aaron Wilson for the original patch.)
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r--IkiWiki.pm13
1 files changed, 13 insertions, 0 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 251ed8cc8..ee94ce659 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -334,6 +334,15 @@ sub getsetup () {
safe => 0, # paranoia
rebuild => 0,
},
+ include => {
+ type => "string",
+ default => undef,
+ example => '^\.htaccess$',
+ description => "regexp of normally ignored source files to include",
+ advanced => 1,
+ safe => 0, # regexp
+ rebuild => 1,
+ },
exclude => {
type => "string",
default => undef,
@@ -1820,6 +1829,10 @@ sub file_pruned ($;$) {
$file =~ s#^\Q$base\E/+##;
}
+ if (defined $config{include} && length $config{include}) {
+ return 0 if $file =~ m/$config{include}/;
+ }
+
my $regexp='('.join('|', @{$config{wiki_file_prune_regexps}}).')';
return $file =~ m/$regexp/;
}