X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/dae0f48e91304afcb6ebe0936360e51b22a56548..118c481766669959c34c30a79aa2667cdcc7aebc:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index 1cbe975c0..5c62c7f9b 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -13,7 +13,9 @@ use vars qw{%config %links %oldlinks %oldpagemtime %pagectime %pagecase use Exporter q{import}; our @EXPORT = qw(hook debug error template htmlpage add_depends pagespec_match bestlink htmllink readfile writefile pagetype srcfile pagename + displaytime %config %links %renderedfiles %pagesources); +our $VERSION = 1.00; # Optimisation. use Memoize; @@ -23,7 +25,7 @@ memoize("pagespec_translate"); my $installdir=''; # INSTALLDIR_AUTOREPLACE done by Makefile, DNE sub defaultconfig () { #{{{ - wiki_file_prune_regexp => qr{((^|/).svn/|\.\.|^\.|\/\.|\.x?html?$|\.rss$)}, + wiki_file_prune_regexp => qr{((^|/).svn/|\.\.|^\.|\/\.|\.x?html?$|\.rss$|.arch-ids/|{arch}/)}, wiki_link_regexp => qr/\[\[(?:([^\]\|]+)\|)?([^\s\]]+)\]\]/, wiki_file_regexp => qr/(^[-[:alnum:]_.:\/+]+$)/, verbose => 0, @@ -60,6 +62,7 @@ sub defaultconfig () { #{{{ timeformat => '%c', locale => undef, sslcookie => 0, + httpauth => 0, } #}}} sub checkconfig () { #{{{ @@ -319,7 +322,7 @@ sub baseurl (;$) { #{{{ sub abs2rel ($$) { #{{{ # Work around very innefficient behavior in File::Spec if abs2rel # is passed two relative paths. It's much faster if paths are - # absolute! + # absolute! (Debian bug #376658) my $path="/".shift; my $base="/".shift; @@ -589,7 +592,7 @@ sub template ($;@) { #{{{ HTML::Template->new(template_params(@_)); } #}}} -sub misctemplate ($$) { #{{{ +sub misctemplate ($$;@) { #{{{ my $title=shift; my $pagebody=shift; @@ -599,8 +602,12 @@ sub misctemplate ($$) { #{{{ indexlink => indexlink(), wikiname => $config{wikiname}, pagebody => $pagebody, - baseurl => baseurl(), + baseurl => baseurl(), + @_, ); + run_hooks(pagetemplate => sub { + shift->(page => "", destpage => "", template => $template); + }); return $template->output; }#}}}