ref: ffc7442ba3ad456be4002a8aa0fbebdb60eaad35
parent: 640aa2f9007f7f035f77be5a904eccf4f2e2dfa5
author: Uriel <u@berlinblue.org>
date: Mon Jun 27 23:48:22 EDT 2011
When more than one file with the same 'name' (eg., foo.md, foo.html) do not display it more than once in dir listings.
--- a/bin/corehandlers.rc
+++ b/bin/corehandlers.rc
@@ -77,7 +77,7 @@
d='/'
echo $d|sed 's,.*//,,g; s,/$,,; s,/, / ,g; 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 | awk '{match($0, "/[^/]*/?$"); l=substr($0, RSTART+1, RLENGTH-1);n=l; gsub(/[\-_]/, " ", n); print "<li><a href=\""l"\">"n"</a></li>"; }'+ 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>"; }' | uniqecho '</ul>'
}
--
⑨