X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/cedb48765b52d3e074f43703cf55611b3bce101d..4345f3af33062217531aa5fa89f7f2e760d4b68f:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index 4e3011918..990836f8e 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -15,10 +15,11 @@ memoize("pagespec_translate"); use vars qw{%config %links %oldlinks %oldpagemtime %pagectime %pagecase %renderedfiles %pagesources %depends %hooks %forcerebuild}; +my $installdir=''; # INSTALLDIR_AUTOREPLACE done by Makefile, DNE + sub defaultconfig () { #{{{ wiki_file_prune_regexp => qr{((^|/).svn/|\.\.|^\.|\/\.|\.x?html?$|\.rss$)}, wiki_link_regexp => qr/\[\[(?:([^\]\|]+)\|)?([^\s\]]+)\]\]/, - wiki_processor_regexp => qr/\[\[(\w+)\s+([^\]]*)\]\]/, wiki_file_regexp => qr/(^[-[:alnum:]_.:\/+]+$)/, verbose => 0, syslog => 0, @@ -45,14 +46,15 @@ sub defaultconfig () { #{{{ srcdir => undef, destdir => undef, pingurl => [], - templatedir => "/usr/share/ikiwiki/templates", - underlaydir => "/usr/share/ikiwiki/basewiki", + templatedir => "$installdir/share/ikiwiki/templates", + underlaydir => "$installdir/share/ikiwiki/basewiki", setup => undef, adminuser => undef, adminemail => undef, plugin => [qw{mdwn inline htmlscrubber}], timeformat => '%c', locale => undef, + sslcookie => 0, } #}}} sub checkconfig () { #{{{ @@ -304,14 +306,14 @@ sub cgiurl (@) { #{{{ return $config{cgiurl}."?".join("&", map "$_=$params{$_}", keys %params); } #}}} -sub styleurl (;$) { #{{{ +sub baseurl (;$) { #{{{ my $page=shift; - return "$config{url}/style.css" if ! defined $page; + return "$config{url}/" if ! defined $page; $page=~s/[^\/]+$//; $page=~s/[^\/]+\//..\//g; - return $page."style.css"; + return $page; } #}}} sub abs2rel ($$) { #{{{ @@ -476,8 +478,7 @@ sub misctemplate ($$) { #{{{ indexlink => indexlink(), wikiname => $config{wikiname}, pagebody => $pagebody, - styleurl => styleurl(), - baseurl => "$config{url}/", + baseurl => baseurl(), ); return $template->output; }#}}} @@ -546,6 +547,8 @@ sub pagespec_merge ($$) { #{{{ my $a=shift; my $b=shift; + return $a if $a eq $b; + # Support for old-style GlobLists. if (is_globlist($a)) { $a=globlist_to_pagespec($a);