~woffs/wcm

0b36d05a0fccda5c12feeba0d1c647ff116d3058 — Frank Doepper 10 years ago caab6b9 20130404
strip extension in all path components
1 files changed, 2 insertions(+), 1 deletions(-)

M index.pl
M index.pl => index.pl +2 -1
@@ 4,7 4,7 @@
# http://woffs.de/WCM
# <wcm@woffs.de>
#
# Version 20130322
# Version 20130404
# 
# Copyright © 2010-2012 WofFS
#


@@ 64,6 64,7 @@ sub walktree ($$$) {
    my $hidden=($&=~/^0/);                 # 00_ 01_ etc. means hidden
    (my $href="$dir/$title")=~s,^$src/,,;  # strip subdir name
    $href=~s/(^|\/)[^_]*_(?=.*\/)/$1/g;    # strip until first _ in all path components
    $href=~s/\.[a-z]+(?=\/)//g;            # strip extension in all path components
    $href=~s/[ ?'"&;]/_/g;                 # replace special chars in links
    my $selected='';                       # highlight selected link
    (my $bhref=$href)=~s,.*/,,;