shithub: sirjofri_de

ref: 236816e6687af6c933682360ff23817a19d06780
dir: /mkfile/

View raw version
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:QV: 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:QV: 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