shithub: ugh

ref: ee19f22be32c725ab41c27918de1e6240d1866fc
dir: /mkfile/

View raw version
sources = `{walk -f data/ | grep -v '^data/\.git/'}
pages = ${sources:data/%=public/%}
md =    `{{for(i in $pages) echo $i}| grep '\.md$'}
txt =   `{{for(i in $pages) echo $i}| grep '\.txt$'}
shtml = `{{for(i in $pages) echo $i}| grep '\.shtml$'}
pages = ${md:   public/%.md=   public/%.html} \
        ${shtml:public/%.shtml=public/%.html} \
        $md $txt \
        public/sitemap.html

all:V: pages

pages:V: $pages

clean:V:
	rm -rf $pages

public/sitemap.md: $sources
	bin/mksitemap data/ >$target

public/sitemap.html: public/sitemap.md
	bin/md2html public/sitemap.md $target

public/%.html: data/%.md
	bin/md2html data/$stem.md $target

public/%.html: data/%.shtml
	cp data/$stem.shtml $target

public/%.md: data/%.md
	cp data/$stem.md $target

public/%.txt: data/%.txt
	cp data/$stem.txt $target