diff -durN -x .hg -x .svn -x .git -x CVS -x .hgtags -x .hglog /m/home/colas/hg/TWiki/420-distrib/lib/TWiki.pm ./lib/TWiki.pm --- /m/home/colas/hg/TWiki/420-distrib/lib/TWiki.pm 2008-01-22 04:18:55.000000000 +0100 +++ ./lib/TWiki.pm 2008-01-27 22:37:03.000000000 +0100 @@ -1075,7 +1075,27 @@ ( $web, $topic ) = $this->normalizeWebTopicName( $web, $topic ); - $url .= urlEncode( '/'.$web.'/'.$topic ); +# START SHORTURLs +# see http://twiki.org/cgi-bin/view/TWiki/ShorterUrlCookbook +# needs $TWiki::cfg{HomeWebName} +# see http://twiki.org/cgi-bin/view/Codev/CreateHomeWebVariable + if ($TWiki::cfg{ShortURLs} && $script eq "view") { + my $topicUrl; + if ($topic eq $TWiki::cfg{HomeTopicName}) { + $topicUrl = ''; + } else { + $topicUrl = $topic; + } + if(defined($TWiki::cfg{HomeWebName}) + && $web eq $TWiki::cfg{HomeWebName}) { + $url .= urlEncode( '/'.$topicUrl ); + } else { + $url .= urlEncode( '/'.$web.'/'.$topicUrl ); + } + } else { + $url .= urlEncode( '/'.$web.'/'.$topic ); + } +# END SHORTURLs $url .= _make_params(0, @params); } diff -durN -x .hg -x .svn -x .git -x CVS -x .hgtags -x .hglog /m/home/colas/hg/TWiki/420-distrib/lib/TWiki.spec ./lib/TWiki.spec --- /m/home/colas/hg/TWiki/420-distrib/lib/TWiki.spec 2008-01-22 04:18:53.000000000 +0100 +++ ./lib/TWiki.spec 2008-01-27 22:48:24.000000000 +0100 @@ -154,6 +154,11 @@ # # $TWiki::cfg{WorkingDir} = '/home/httpd/twiki/working'; +# **BOOLEAN** +# So we shorten autolink URLs? i.e. omit the topic name if it is WebHome +# and the Web name if it is Home? +$TWiki::cfg{ShortURLs} = 0; + # **STRING 10** # Suffix of TWiki CGI scripts (e.g. .cgi or .pl). You may need to set this # if your webserver requires an extension.