ref: dd409c1d4465c296f11e2db92ecd5121403d4dcd
dir: /mkfile/
PATHS=`{ls *.ht */*.ht | sed -e 's/\.ht$//g' | grep -v 'index'}
OBJECTS=`{echo 'pub/'^$PATHS^'/index.html'}
nl='
'
prepare:QV: changeblog.ht
echo 'Prepare complete'
mk build
build:QV: $OBJECTS pub/index.html
echo 'Build complete'
changeblog.ht:QV:
echo '<section>
<header>
<h2>all articles</h2>
</header>
<ul>' > $target
obs=`{ls changeblog/*.ht | sed -e 's/\.ht$//g' -e 's:changeblog/::g'}
for(OB in $obs){
OBN=`"{sed -n '/h2/s:</?h2>::gp' changeblog/^$OB^.ht | tr -d $nl}
echo '<li><a href="/changeblog/'^$OB^'/">'$OB': '$OBN'</a></li>' >> $target
}
echo '</ul>
</section>' >> $target
echo '√ '$target' prepared'
pub/index.html:Q: head.htf index.ht foot.htf
if(! test -d pub)
mkdir pub
cat $prereq | sed -e 's:PAGETITLE:sirjofri:g' > pub/index.html
echo '√ '^$target
pub/%/index.html:Q: head.htf %.ht foot.htf
dirpart=`{basename -d $target}
if(! test -d $dirpart)
mkdir -p $dirpart
cat $prereq | sed -e 's:PAGETITLE:'^$stem^':g' > pub/$stem/index.html
echo '√ '^$target