From f1f653f876904d4fabce9a42a71563bdfc78033e Mon Sep 17 00:00:00 2001 From: Uriel Date: Sat, 20 Dec 2008 13:20:31 +0100 Subject: [PATCH] Sitemap improvemnts and cleanups: - Avoid nedless tests - Replace reference to /bin/sed with faster, simpler and probably more correct plan9 sed call. - Move inline html styling to style.css - Various code cleanups, bring source style in line with other werc source. --- lib/sitemap.tpl | 55 ++++++++++++++++++++++++--------------------- pub/style/style.css | 3 +++ 2 files changed, 33 insertions(+), 25 deletions(-) diff --git a/lib/sitemap.tpl b/lib/sitemap.tpl index 4aaa75f..fbd143f 100644 --- a/lib/sitemap.tpl +++ b/lib/sitemap.tpl @@ -3,7 +3,7 @@ %{ tmpfile=/tmp/werc_sitemap_$pid.txt echo '' > $tmpfile -saveddf = $dirfilter +saveddf=$dirfilter fn getMdDesc { sed 's/^(.......................................................................................................[^ ]*).*$/\1/g; 1q' < $1 @@ -11,51 +11,56 @@ fn getMdDesc { fn listDir { d=$1 - dirfilter = $saveddf - blogDirs = () - if (test -f $d/_werc/config) - . $d/_werc/config + if(~ $#d 0) + d='' + dirfilter=$saveddf + blogDirs=() + if(test -f $d/_werc/config) + . ./$d/_werc/config - echo '