ref: 68e2a143ca8976c543348fcd208966ef0367129b
dir: /bloglist/
#!/bin/rc -e . /sys/lib/hlfw/common.rc cd $1 shift cache=/usr/web/cache/bloglist.cache tcache=/usr/web/cache/bloglist.cache.tmp.$pid if(test -e $cache && ! test $cache -older 1m){ exec cat $cache exit } rfork ne nl=' ' { prelude '' 'blog' echo '<h2>Blogs</h2>' udir=() for(repo in `$nl{ls}){ ## sort by year, then strip the .md out name=`{echo $repo | sed 's/\.md//'} echo '<dt><a href="/blog/'$name'.html">'$name'</a></dt>' } } | tee $tcache && mv $tcache $cache