shithub: werc

ref: d2861fd8f00aa15323ee136f612d7b36c8fea0f5
dir: /apps/blagh/app.rc/

View raw version
fn blagh_test {
    ! ~ $#blaghDirs 0 # && test -d / `{echo '-a -d '^blaghDirs}
}

fn blagh_setup {
    app_body_handler='blagh_body'
}

fn blagh_body {
    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 {
    l=`{echo $1 | sed 's|'$sitedir$req_path'||'}
    sed '1s|.*|[&]('$l')|' < $1/index.md  
}