Handle dir listing of site root.
This commit is contained in:
parent
f23d0176ce
commit
55d12e5dac
1 changed files with 2 additions and 0 deletions
|
|
@ -69,6 +69,8 @@ fn txt_handler {
|
||||||
|
|
||||||
fn dir_listing_handler {
|
fn dir_listing_handler {
|
||||||
d=`{basename -d $1}
|
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">,'
|
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.
|
# 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>,'
|
ls -F $dir_listing_ls_opts $sitedir$d/. | sed $dirfilter$dirclean' s,.*/([^/]+/?)$,<li><a href="\1">\1</a></li>,'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue