changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > werc / changeset: Make dir listings a bit prettier by replacing [-_] with spaces.

changeset 644: dfe8d94928c1
parent 643: e7176fc9e323
child 645: 5d64147a918f
author: Uriel <u@berlinblue.org>
date: Mon, 28 Jun 2010 09:06:45 +0000
files: bin/corehandlers.rc
description: Make dir listings a bit prettier by replacing [-_] with spaces.
     1.1--- a/bin/corehandlers.rc	Sat Jun 26 03:54:41 2010 +0000
     1.2+++ b/bin/corehandlers.rc	Mon Jun 28 09:06:45 2010 +0000
     1.3@@ -75,9 +75,9 @@
     1.4     d=`{basename -d $1}
     1.5     if(~ $#d 0)
     1.6         d='/'
     1.7-    echo $d|sed 's,.*//,,g; s,/$,,; s,/, / ,g; s,.*,<h1 class="dir-list-head">&</h1> <ul class="dir-list">,'
     1.8+    echo $d|sed 's,.*//,,g; s,/$,,; s,/, / ,g; s/[\-_]/ /g; s,.*,<h1 class="dir-list-head">&</h1> <ul class="dir-list">,'
     1.9     # Symlinks suck: '/.' forces ls to list the linked dir if $d is a symlink.
    1.10-    ls -F $dir_listing_ls_opts $sitedir$d/. | sed $dirfilter$dirclean' s,.*/([^/]+/?)$,<li><a href="\1">\1</a></li>,'
    1.11+    ls -F $dir_listing_ls_opts $sitedir$d/. | sed $dirfilter$dirclean | awk '{match($0, "/[^/]*/?$"); l=substr($0, RSTART+1, RLENGTH-1);n=l; gsub(/[\-_]/, " ", n); print "<li><a href=\""l"\">"n"</a></li>"; }'
    1.12     echo '</ul>'
    1.13 }
    1.14