]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - ikiwiki
Implemented --underlaydir, and moved files provided by underlay out of doc
[git.ikiwiki.info.git] / ikiwiki
diff --git a/ikiwiki b/ikiwiki
index 7a16be3ca907a411d907dd467985b289e05434de..4ef6ceba39d3e7cb07dd32ea27dc27bade27bdf4 100755 (executable)
--- a/ikiwiki
+++ b/ikiwiki
@@ -18,7 +18,7 @@ sub usage () { #{{{
 sub getconfig () { #{{{
        if (! exists $ENV{WRAPPED_OPTIONS}) {
                %config=(
 sub getconfig () { #{{{
        if (! exists $ENV{WRAPPED_OPTIONS}) {
                %config=(
-                       wiki_file_prune_regexp => qr{((^|/).svn/|\.\.|^\.|\/\.|\.html?$)},
+                       wiki_file_prune_regexp => qr{((^|/).svn/|\.\.|^\.|\/\.|\.html?$|\.rss$)},
                        wiki_link_regexp => qr/\[\[(?:([^\s\]\|]+)\|)?([^\s\]]+)\]\]/,
                        wiki_processor_regexp => qr/\[\[(\w+)\s+([^\]]+)\]\]/,
                        wiki_file_regexp => qr/(^[-A-Za-z0-9_.:\/+]+$)/,
                        wiki_link_regexp => qr/\[\[(?:([^\s\]\|]+)\|)?([^\s\]]+)\]\]/,
                        wiki_processor_regexp => qr/\[\[(\w+)\s+([^\]]+)\]\]/,
                        wiki_file_regexp => qr/(^[-A-Za-z0-9_.:\/+]+$)/,
@@ -41,6 +41,7 @@ sub getconfig () { #{{{
                        srcdir => undef,
                        destdir => undef,
                        templatedir => "/usr/share/ikiwiki/templates",
                        srcdir => undef,
                        destdir => undef,
                        templatedir => "/usr/share/ikiwiki/templates",
+                       underlaydir => "/usr/share/ikiwiki/basewiki",
                        setup => undef,
                        adminuser => undef,
                );
                        setup => undef,
                        adminuser => undef,
                );
@@ -71,6 +72,9 @@ sub getconfig () { #{{{
                        "templatedir=s" => sub {
                                $config{templatedir}=possibly_foolish_untaint($_[1])
                        },
                        "templatedir=s" => sub {
                                $config{templatedir}=possibly_foolish_untaint($_[1])
                        },
+                       "underlaydir=s" => sub {
+                               $config{underlaydir}=possibly_foolish_untaint($_[1])
+                       },
                        "wrapper:s" => sub {
                                $config{wrapper}=$_[1] ? $_[1] : "ikiwiki-wrap"
                        },
                        "wrapper:s" => sub {
                                $config{wrapper}=$_[1] ? $_[1] : "ikiwiki-wrap"
                        },
@@ -176,6 +180,14 @@ sub htmlpage ($) { #{{{
        return $page.".html";
 } #}}}
 
        return $page.".html";
 } #}}}
 
+sub srcfile ($) { #{{{
+       my $file=shift;
+
+       return "$config{srcdir}/$file" if -e "$config{srcdir}/$file";
+       return "$config{underlaydir}/$file" if -e "$config{underlaydir}/$file";
+       error("internal error: $file cannot be found");
+} #}}}
+
 sub readfile ($) { #{{{
        my $file=shift;
 
 sub readfile ($) { #{{{
        my $file=shift;