werc/apps/blagh/app.rc

20 lines
511 B
Plaintext
Raw Normal View History

2008-12-24 04:19:06 -07:00
fn blagh_test {
! ~ $#blaghDirs 0 # && test -d / `{echo '-a -d '^blaghDirs}
}
fn blagh_setup {
app_body_handler='blagh_body'
}
fn blagh_body {
2008-12-27 03:47:36 -07:00
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,/+\|/+,/,'}
2008-12-24 04:19:06 -07:00
for(p in $posts)
show_post $p | $formatter
}
fn show_post {
2008-12-27 03:47:36 -07:00
l=`{echo $1 | sed 's|'$sitedir$req_path'||'}
sed '1s|.*|[&]('$l')|' < $1/index.md
2008-12-24 04:19:06 -07:00
}