X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/094af3d113f375f7faf2abf283615582a9977a65..c696239b6b1ce6b3a3ee20cc88eb5fcb48c0bb7d:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index 245eaafba..ba1847093 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -411,7 +411,7 @@ sub getsetup () { #{{{ rebuild => 0, }, allow_symlinks_before_srcdir => { - type => "string", + type => "boolean", default => 0, description => "allow symlinks in the path leading to the srcdir (potentially insecure)", safe => 0, @@ -655,8 +655,19 @@ sub newpagefile ($$) { #{{{ sub targetpage ($$) { #{{{ my $page=shift; my $ext=shift; - - if (! $config{usedirs} || $page eq 'index') { + + my $targetpage=''; + run_hooks(targetpage => sub { + $targetpage=shift->( + page => $page, + ext => $ext, + ); + }); + + if (defined $targetpage && (length($targetpage) > 0)) { + return $targetpage; + } + elsif (! $config{usedirs} || $page eq 'index') { return $page.".".$ext; } else { @@ -931,6 +942,10 @@ sub beautify_urlpath ($) { #{{{ $url =~ s!/index.$config{htmlext}$!/!; } + run_hooks(tweakurlpath => sub { + $url=shift->(url => $url); + }); + # Ensure url is not an empty link, and # if it's relative, make that explicit to avoid colon confusion. if ($url !~ /^\//) { @@ -1582,8 +1597,8 @@ sub rcs_getctime ($) { #{{{ $hooks{rcs}{rcs_getctime}{call}->(@_); } #}}} -sub rcs_test_receive ($) { #{{{ - $hooks{rcs}{rcs_test_receive}{call}->(@_); +sub rcs_receive () { #{{{ + $hooks{rcs}{rcs_receive}{call}->(); } #}}} sub globlist_to_pagespec ($) { #{{{