swerc

anselm's simpler werc fork
git clone git://git.suckless.org/swerc
Log | Files | Refs | README

commit c19d3e4bbdc52dcff4a5d323bc0907d29f840fe8
parent 088f296c9b04e9b91a75316d1333b426cd77b6af
Author: Uriel <u@berlinblue.org>
Date:   Tue, 28 Jun 2011 03:48:22 +0000

When more than one file with the same 'name' (eg., foo.md, foo.html) do not display it more than once in dir listings.
Diffstat:
bin/corehandlers.rc | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/corehandlers.rc b/bin/corehandlers.rc @@ -77,7 +77,7 @@ fn dir_listing_handler { 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>"; }' | uniq echo '</ul>' }