Handle dir listing of site root.

This commit is contained in:
Uriel 2009-01-26 04:51:06 +01:00
parent f23d0176ce
commit 55d12e5dac

View file

@ -69,6 +69,8 @@ fn txt_handler {
fn dir_listing_handler {
d=`{basename -d $1}
if(~ $#d 0)
d='/'
echo $d|sed 's,.*//,,g; s,/$,,; s,/, / ,g; s,.*,<h1 class="dir-list-head">&</h1> <ul class="dir-list">,'
# Symlinks suck: '/.' forces ls to list the linked dir if $d is a symlink.
ls -F $dir_listing_ls_opts $sitedir$d/. | sed $dirfilter$dirclean' s,.*/([^/]+/?)$,<li><a href="\1">\1</a></li>,'