ref: e825f311aba102a55316662ec51342d544eb125a
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=() echo '<nav><ul>' for(repo in `$nl{ls | sort -r}){ ## sort by year, then strip the .md out name=`{echo $repo | sed 's/\.md//'} echo '<li><a href="/blog/'$name'.html">'$name'</a></li>' } echo '</nav></ul>' } | tee $tcache && mv $tcache $cache