shithub: sirjofri_de

ref: 549e06dd55c8946b3ee925c55050eb682b9b8bc1
dir: /mkfile/

View raw version
PATHS=`{ls *.ht */*.ht | sed -e 's/\.ht$//g' | grep -v 'index'}
OBJECTS=`{echo 'pub/'^$PATHS^'/index.html'}

prepare:QV: changeblog.ht
	echo 'Prepare complete'
	mk build

build:QV: $OBJECTS pub/index.html
	echo 'Build complete'

changeblog.ht:Q:
	echo '<section>
	<header>
	<h2>all articles</h2>
	</header>
	<ul>' > $target
	obs=`{basename `{ls changeblog/*.ht | sed -e 's/\.ht$//g'}}
	for(OB in $obs){
		echo '<li><a href="/changeblog/'^$OB^'/">'$OB'</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