ref: 94c0205e99c4fa49dce8963a580ad37e2963f24f
parent: e9d149ec59a8201bcb7036e207b8a184612e7a19
author: uriel <uriel@engel.se.cat-v.org>
date: Sat Dec 27 06:47:36 EST 2008
Further simplification/cleanup.
--- a/apps/blagh/app.rc
+++ b/apps/blagh/app.rc
@@ -7,13 +7,13 @@
}
fn blagh_body {
- posts=`{ls -F $blaghDirs^/./[0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9]/ | sed -n 's,/\./,/|/,; /\/$/p' | sort -r '-t|' +1 | sed 's,/+\|/+,/,'}
+ d=$sitedir$req_path^$blaghDirs^/./[0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9]/
+ posts=`{ls -F $d >[2]/dev/null | sed -n 's,/\./,/|/,; /\/$/p' | sort -r '-t|' +1 | sed 's,/+\|/+,/,'}
for(p in $posts)
show_post $p | $formatter
}
fn show_post {
- bds=$blaghDirs^'|'
- l=`{echo $1 |sed 's,'$bds'XXX,,g'}
- sed '1s|.*|[&]('$l') -'^$l'|' < $1/index.md
+ l=`{echo $1 | sed 's|'$sitedir$req_path'||'}
+ sed '1s|.*|[&]('$l')|' < $1/index.md
}